* desc.c (decode_select): Fix potential stack buffer overflow.

This commit is contained in:
Дмитрий Левин 2010-04-06 23:50:49 +00:00
parent 4310a375e9
commit 6e63375495

3
desc.c
View File

@ -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" :