diff options
author | Peter Eisentraut | 2007-02-07 00:32:15 +0000 |
---|---|---|
committer | Peter Eisentraut | 2007-02-07 00:32:15 +0000 |
commit | 5b0af8870eff545ccdb02d8dc385eeb52c4843e5 (patch) | |
tree | af51564b59e57b957995ab4417ccd3808e3d4d88 | |
parent | d376caa72368a28b07579fa90a95a04a7888bf43 (diff) |
Use memcpy() instead of strncpy() for copying into varlena structures.
-rw-r--r-- | contrib/intarray/_int_bool.c | 2 | ||||
-rw-r--r-- | contrib/tsearch2/query.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/contrib/intarray/_int_bool.c b/contrib/intarray/_int_bool.c index 8517010e5e..23ee8f1dad 100644 --- a/contrib/intarray/_int_bool.c +++ b/contrib/intarray/_int_bool.c @@ -779,7 +779,7 @@ querytree(PG_FUNCTION_ARGS) res = (text *) palloc(nrm.cur - nrm.buf + VARHDRSZ); VARATT_SIZEP(res) = nrm.cur - nrm.buf + VARHDRSZ; - strncpy(VARDATA(res), nrm.buf, nrm.cur - nrm.buf); + memcpy(VARDATA(res), nrm.buf, nrm.cur - nrm.buf); } pfree(q); diff --git a/contrib/tsearch2/query.c b/contrib/tsearch2/query.c index b832deb22e..902ee22fe5 100644 --- a/contrib/tsearch2/query.c +++ b/contrib/tsearch2/query.c @@ -928,7 +928,7 @@ tsquerytree(PG_FUNCTION_ARGS) res = (text *) palloc(nrm.cur - nrm.buf + VARHDRSZ); VARATT_SIZEP(res) = nrm.cur - nrm.buf + VARHDRSZ; - strncpy(VARDATA(res), nrm.buf, nrm.cur - nrm.buf); + memcpy(VARDATA(res), nrm.buf, nrm.cur - nrm.buf); pfree(q); } |