Use Size rather than int for storing strnlen's return

... in fe_memutils.c's pnstrdup().

strnlen() does return size_t, so it seems better to use the Size input
parameter to store the return value rather than demote it to int and
risk larger values being truncated.

Pushing only to master as this doesn't seem like an actual problem.
Fixing will hopefully prevent future LLM-triggered reports about this.

Author: Chao Li <[email protected]>
Discussion: https://postgr.es/m/[email protected]

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/38c3d87d43397ab600f085e398789f3dea1cd0a5

Modified Files
--------------
src/common/fe_memutils.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

Reply via email to