[pgpool-committers: 2028] pgpool: Fix non null terminated string problem by using StrNCpy instead

Tatsuo Ishii ishii at postgresql.org
Sun Jun 15 19:46:51 JST 2014


Fix non null terminated string problem by using StrNCpy instead of strncpy.

Covery says:
>>>     Calling strncpy with a source string whose length (64 chars) is greater than or equal to the size argument (64) will fail to null-terminate "(status + i).desc".

strncpy copies exact 64 bytes source string up to 64 bytes specified
by the third argument. In this case the destination string is not null
terminated. To fix the problem replace all the occurrence of strncpy to StrNCpy.

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=e5bffcb66bfc1f10e7ff2514e7b3969a91d02832

Modified Files
--------------
src/utils/pool_process_reporting.c |  534 ++++++++++++++++++------------------
1 file changed, 267 insertions(+), 267 deletions(-)



More information about the pgpool-committers mailing list