]> granicus.if.org Git - procps-ng/commit
0052-ps/output.c: Handle negative snprintf() return value.
authorQualys Security Advisory <qsa@qualys.com>
Thu, 1 Jan 1970 00:00:00 +0000 (00:00 +0000)
committerCraig Small <csmall@enc.com.au>
Sat, 9 Jun 2018 11:45:38 +0000 (21:45 +1000)
commit9caf95c0bd2df7a622b3839a13d5db102282e717
tree922096a3ed7efb1c70360093862c8b9edf04c039
parentf44fe715bd621846ee2a490b05a5c9b98b662045
0052-ps/output.c: Handle negative snprintf() return value.

May happen if strlen(src) > INT_MAX for example. This patch prevents
escaped_copy() from increasing maxroom and returning -1 (= number of
bytes consumed in dst).

---------------------------- adapted for newlib branch
. formerly applied to proc/escape.c
. function was moved to ps/output.c

Signed-off-by: Jim Warner <james.warner@comcast.net>
ps/output.c