OSDN Git Service

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 ca254f9..53093f1 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;