]> git.droids-corp.org - dpdk.git/blobdiff - examples/ip_pipeline/tap.c
mem: fix potential underflow on mem size calculation
[dpdk.git] / examples / ip_pipeline / tap.c
index a0f60867f7546ff7d69b6d82a12700a2e7fca4ca..11e4ad20e24f0a8092b5a492657f5e72db38e582 100644 (file)
@@ -15,6 +15,8 @@
 #include <string.h>
 #include <unistd.h>
 
 #include <string.h>
 #include <unistd.h>
 
+#include <rte_string_fns.h>
+
 #include "tap.h"
 
 #define TAP_DEV                                            "/dev/net/tun"
 #include "tap.h"
 
 #define TAP_DEV                                            "/dev/net/tun"
@@ -88,7 +90,7 @@ tap_create(const char *name)
                return NULL;
        }
        /* Node fill in */
                return NULL;
        }
        /* Node fill in */
-       strncpy(tap->name, name, sizeof(tap->name));
+       strlcpy(tap->name, name, sizeof(tap->name));
        tap->fd = fd;
 
        /* Node add to list */
        tap->fd = fd;
 
        /* Node add to list */