* syscalls.cc (utmp_data): Fix potential buffer overflow.
This commit is contained in:
parent
adef8606bd
commit
2daa7e07ce
|
@ -1,3 +1,7 @@
|
||||||
|
2011-01-31 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* syscalls.cc (utmp_data): Fix potential buffer overflow.
|
||||||
|
|
||||||
2011-01-31 Corinna Vinschen <corinna@vinschen.de>
|
2011-01-31 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* fhandler_socket.cc (address_in_use): Improve comment readability.
|
* fhandler_socket.cc (address_in_use): Improve comment readability.
|
||||||
|
|
|
@ -3508,7 +3508,7 @@ static struct utmp utmp_data_buf[16];
|
||||||
static unsigned utix = 0;
|
static unsigned utix = 0;
|
||||||
#define nutdbuf (sizeof (utmp_data_buf) / sizeof (utmp_data_buf[0]))
|
#define nutdbuf (sizeof (utmp_data_buf) / sizeof (utmp_data_buf[0]))
|
||||||
#define utmp_data ({ \
|
#define utmp_data ({ \
|
||||||
if (utix > nutdbuf) \
|
if (utix >= nutdbuf) \
|
||||||
utix = 0; \
|
utix = 0; \
|
||||||
utmp_data_buf + utix++; \
|
utmp_data_buf + utix++; \
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue