]> granicus.if.org Git - strace/commitdiff
* desc.c (decode_select): Fix potential stack buffer overflow.
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 6 Apr 2010 23:50:49 +0000 (23:50 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 7 Apr 2010 00:05:01 +0000 (00:05 +0000)
desc.c

diff --git a/desc.c b/desc.c
index 383107e30d7056f71de7f9bb7ebeb8b3f0baf8fd..c615663aa20205306bf2f7e850cb85055cd76f30 100644 (file)
--- 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" :