Avoid uninitialized bits in the result of QTN2QT().
authorTom Lane <[email protected]>
Tue, 24 May 2011 18:20:08 +0000 (14:20 -0400)
committerTom Lane <[email protected]>
Tue, 24 May 2011 18:21:19 +0000 (14:21 -0400)
Found with additional valgrind testing.

Noah Misch

src/backend/utils/adt/tsquery_util.c

index 831936696b722272089f9cd8593aaa2353a70af0..d4a2ede1f627e5d6b5809c452b37514741d2f44f 100644 (file)
@@ -336,7 +336,7 @@ QTN2QT(QTNode *in)
    cntsize(in, &sumlen, &nnode);
    len = COMPUTESIZE(nnode, sumlen);
 
-   out = (TSQuery) palloc(len);
+   out = (TSQuery) palloc0(len);
    SET_VARSIZE(out, len);
    out->size = nnode;