Changed some strcpys to strncpy to avoid troublesome warnings on paranoid systems...
authorAndreas Tonnesen <andreto@olsr.org>
Tue, 17 May 2005 23:53:01 +0000 (23:53 +0000)
committerAndreas Tonnesen <andreto@olsr.org>
Tue, 17 May 2005 23:53:01 +0000 (23:53 +0000)
src/interfaces.c
src/linux/net.c

index 0c3ef70..b03cec0 100644 (file)
@@ -36,7 +36,7 @@
  * to the project. For more information see the website or contact
  * the copyright holders.
  *
- * $Id: interfaces.c,v 1.21 2005/03/07 07:08:02 kattemat Exp $
+ * $Id: interfaces.c,v 1.22 2005/05/17 23:53:01 kattemat Exp $
  */
 
 #include "defs.h"
@@ -330,7 +330,7 @@ queue_if(char *name)
   interf_n->configured = 0;
   interf_n->index = olsr_cnf->ifcnt++;
 
-  strcpy(interf_n->name, name);
+  strncpy(interf_n->name, name, sizeof(interf_n->name));
   interf_n->next = olsr_cnf->interfaces;
   olsr_cnf->interfaces = interf_n;
 
index 710ba32..38f1108 100644 (file)
@@ -36,7 +36,7 @@
  * to the project. For more information see the website or contact
  * the copyright holders.
  *
- * $Id: net.c,v 1.24 2005/03/04 21:30:16 kattemat Exp $
+ * $Id: net.c,v 1.25 2005/05/17 23:53:01 kattemat Exp $
  */
 
 
@@ -100,12 +100,12 @@ enable_ip_forwarding(int version)
 
   if(version == AF_INET)
     {
-      strcpy(procfile, "/proc/sys/net/ipv4/ip_forward");
+      strncpy(procfile, "/proc/sys/net/ipv4/ip_forward", FILENAME_MAX);
     }
   else
     if(version == AF_INET6)
       {
-       strcpy(procfile, "/proc/sys/net/ipv6/conf/all/forwarding");
+       strncpy(procfile, "/proc/sys/net/ipv6/conf/all/forwarding", FILENAME_MAX);
       }
     else
       return -1;