]> granicus.if.org Git - postgresql/commitdiff
Avoid uninitialized bits in the result of QTN2QT().
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 24 May 2011 18:20:08 +0000 (14:20 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 24 May 2011 18:22:05 +0000 (14:22 -0400)
Found with additional valgrind testing.

Noah Misch

src/backend/utils/adt/tsquery_util.c

index fd5430ce166c79370ecc4c398a4b4817e0a18a70..01afc4e0bbb25efb30ce0034563324dd4c5d8dc1 100644 (file)
@@ -339,7 +339,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;