File libnet-1.1.5-arrray-fix.diff of Package libnet
---
src/libnet_cq.c | 4 ++--
src/libnet_init.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
Index: src/libnet_cq.c
===================================================================
--- src/libnet_cq.c.orig 2010-11-19 11:32:51.750943104 +0100
+++ src/libnet_cq.c 2010-11-19 11:33:29.934865042 +0100
@@ -116,7 +116,7 @@
/* label the context with the user specified string */
strncpy(l->label, label, LIBNET_LABEL_SIZE);
- l->label[LIBNET_LABEL_SIZE] = '\0';
+ l->label[LIBNET_LABEL_SIZE - 1] = '\0';
l_cq->next = NULL;
l_cq->prev = NULL;
@@ -147,7 +147,7 @@
/* label the context with the user specified string */
strncpy(l->label, label, LIBNET_LABEL_SIZE);
- l->label[LIBNET_LABEL_SIZE] = '\0';
+ l->label[LIBNET_LABEL_SIZE - 1] = '\0';
new->next = l_cq;
new->prev = NULL;
Index: src/libnet_init.c
===================================================================
--- src/libnet_init.c.orig 2010-11-19 11:32:51.750943104 +0100
+++ src/libnet_init.c 2010-11-19 11:33:29.986870383 +0100
@@ -71,7 +71,7 @@
l->fd = -1;
strncpy(l->label, LIBNET_LABEL_DEFAULT, LIBNET_LABEL_SIZE);
- l->label[sizeof(l->label)] = '\0';
+ l->label[sizeof(l->label) - 1] = '\0';
switch (l->injection_type)
{