mirror of
https://git.freebsd.org/ports.git
synced 2025-06-24 06:00:30 -04:00
2001-11-27 Flavio Veloso <flaviovs@magnux.com> * gnuserv.c: Fix a potential buffer overflow in permitted() that may allow the client to execute code on the server.
15 lines
427 B
C
15 lines
427 B
C
--- src/daemon/gnuserv.c.orig Thu Nov 29 08:58:40 2001
|
|
+++ src/daemon/gnuserv.c Thu Nov 29 08:58:17 2001
|
|
@@ -200,6 +200,12 @@
|
|
|
|
auth_data_len = atoi (buf);
|
|
|
|
+ if (auth_data_len < 1 || auth_data_len > sizeof(buf)) {
|
|
+ syslog_message(LOG_WARNING,
|
|
+ "Invalid data length supplied by client");
|
|
+ return FALSE;
|
|
+ }
|
|
+
|
|
if (timed_read (fd, buf, auth_data_len, AUTH_TIMEOUT, 0) != auth_data_len)
|
|
return FALSE;
|
|
|