From: Dmitry V. Levin Date: Tue, 6 Apr 2010 23:50:49 +0000 (+0000) Subject: * desc.c (decode_select): Fix potential stack buffer overflow. X-Git-Tag: v4.5.20~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6e6337549506469fd6dc3e20e7623f3161b476f6;p=strace * desc.c (decode_select): Fix potential stack buffer overflow. --- diff --git a/desc.c b/desc.c index 383107e3..c615663a 100644 --- a/desc.c +++ b/desc.c @@ -546,7 +546,6 @@ decode_select(struct tcb *tcp, long *args, enum bitness_t bitness) outstr[0] = '\0'; for (i = 0; i < 3; i++) { int first = 1; - char str[20]; tcp->auxstr = outstr; arg = args[i+1]; @@ -555,6 +554,8 @@ decode_select(struct tcb *tcp, long *args, enum bitness_t bitness) continue; for (j = 0; j < args[0]; j++) { if (FD_ISSET(j, fds)) { + char str[11 + 3 * sizeof(int)]; + if (first) { sprintf(str, "%s%s [%u", sep, i == 0 ? "in" :