[svn-commits] mmichelson: branch 1.2 r3205 - in /branches/1.2: sethdlc-new.c sethdlc.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Oct 31 16:08:15 CDT 2007


Author: mmichelson
Date: Wed Oct 31 16:08:15 2007
New Revision: 3205

URL: http://svn.digium.com/view/zaptel?view=rev&rev=3205
Log:
Fixed potential buffer overflow.

See AST-2007-024 for more details


Modified:
    branches/1.2/sethdlc-new.c
    branches/1.2/sethdlc.c

Modified: branches/1.2/sethdlc-new.c
URL: http://svn.digium.com/view/zaptel/branches/1.2/sethdlc-new.c?view=diff&rev=3205&r1=3204&r2=3205
==============================================================================
--- branches/1.2/sethdlc-new.c (original)
+++ branches/1.2/sethdlc-new.c Wed Oct 31 16:08:15 2007
@@ -673,7 +673,7 @@
 	if (sock < 0)
 		error("Unable to create socket: %s\n", strerror(errno));
   
-	strcpy(req.ifr_name, argv[1]); /* Device name */
+	strncpy(req.ifr_name, argv[1], sizeof(req.ifr_name) - 1); /* Device name */
 
 	if (argc == 2)
 		show_port();

Modified: branches/1.2/sethdlc.c
URL: http://svn.digium.com/view/zaptel/branches/1.2/sethdlc.c?view=diff&rev=3205&r1=3204&r2=3205
==============================================================================
--- branches/1.2/sethdlc.c (original)
+++ branches/1.2/sethdlc.c Wed Oct 31 16:08:15 2007
@@ -293,7 +293,7 @@
 	if (sock<0)
 		error("Unable to create socket: %s\n", strerror(errno));
   
-	strcpy(req.ifr_name, argv[1]); /* Device name */
+	strncpy(req.ifr_name, argv[1], sizeof(req.ifr_name) - 1); /* Device name */
 
 	if (argc == 2) {
 		show_port(sock);




More information about the svn-commits mailing list