From 6e6337549506469fd6dc3e20e7623f3161b476f6 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Tue, 6 Apr 2010 23:50:49 +0000 Subject: [PATCH] * desc.c (decode_select): Fix potential stack buffer overflow. --- desc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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" :