iliaa Mon Feb 2 22:10:28 2004 EDT Modified files: /php-src/ext/snmp snmp.c Log: Fixed possible overflow. http://cvs.php.net/diff.php/php-src/ext/snmp/snmp.c?r1=1.90&r2=1.91&ty=u Index: php-src/ext/snmp/snmp.c diff -u php-src/ext/snmp/snmp.c:1.90 php-src/ext/snmp/snmp.c:1.91 --- php-src/ext/snmp/snmp.c:1.90 Thu Jan 8 03:17:26 2004 +++ php-src/ext/snmp/snmp.c Mon Feb 2 22:10:28 2004 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: snmp.c,v 1.90 2004/01/08 08:17:26 andi Exp $ */ +/* $Id: snmp.c,v 1.91 2004/02/03 03:10:28 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -582,7 +582,7 @@ } snmp_sess_init(&session); - strcpy (hostname, Z_STRVAL_PP(a1)); + strlcpy(hostname, Z_STRVAL_PP(a1), sizeof(hostname)); if ((pptr = strchr (hostname, ':'))) { remote_port = strtol (pptr + 1, NULL, 0); } @@ -907,7 +907,7 @@ /* Reading the hostname and its optional non-default port number */ convert_to_string_ex(a1); - strcpy(hostname, Z_STRVAL_PP(a1)); + strlcpy(hostname, Z_STRVAL_PP(a1), sizeof(hostname)); if ((pptr = strchr (hostname, ':'))) { remote_port = strtol (pptr + 1, NULL, 0); }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php