* desc.c (decode_select): Fix potential stack buffer overflow.
This commit is contained in:
3
desc.c
3
desc.c
@ -546,7 +546,6 @@ decode_select(struct tcb *tcp, long *args, enum bitness_t bitness)
|
|||||||
outstr[0] = '\0';
|
outstr[0] = '\0';
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
int first = 1;
|
int first = 1;
|
||||||
char str[20];
|
|
||||||
|
|
||||||
tcp->auxstr = outstr;
|
tcp->auxstr = outstr;
|
||||||
arg = args[i+1];
|
arg = args[i+1];
|
||||||
@ -555,6 +554,8 @@ decode_select(struct tcb *tcp, long *args, enum bitness_t bitness)
|
|||||||
continue;
|
continue;
|
||||||
for (j = 0; j < args[0]; j++) {
|
for (j = 0; j < args[0]; j++) {
|
||||||
if (FD_ISSET(j, fds)) {
|
if (FD_ISSET(j, fds)) {
|
||||||
|
char str[11 + 3 * sizeof(int)];
|
||||||
|
|
||||||
if (first) {
|
if (first) {
|
||||||
sprintf(str, "%s%s [%u", sep,
|
sprintf(str, "%s%s [%u", sep,
|
||||||
i == 0 ? "in" :
|
i == 0 ? "in" :
|
||||||
|
Reference in New Issue
Block a user