]> 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:20:08 +0000 (14:20 -0400)
Found with additional valgrind testing.

Noah Misch

src/backend/utils/adt/tsquery_util.c

index ca254f901f133e059207f4f8bf4660b837a42883..53093f1e8646dafb07e426099f84e1c3abb3140a 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;