mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
Use memcpy() instead of strncpy() for copying into varlena structures.
This commit is contained in:
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user