From fca2ffb3a05ed8f04121781a56c75e80611b6f8d Mon Sep 17 00:00:00 2001 From: Ethan Jackson Date: Mon, 31 Jan 2011 22:45:58 -0800 Subject: [PATCH] lib: Fix off-by-one error in route-table. --- lib/route-table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/route-table.c b/lib/route-table.c index 29d81bb3..64a5c1e9 100644 --- a/lib/route-table.c +++ b/lib/route-table.c @@ -446,7 +446,7 @@ name_table_reset(void) nn = xzalloc(sizeof *nn); nn->ifi_index = change.ifi_index; strncpy(nn->ifname, change.ifname, IFNAMSIZ); - nn->ifname[IFNAMSIZ] = '\0'; + nn->ifname[IFNAMSIZ - 1] = '\0'; hmap_insert(&name_map, &nn->node, hash_int(nn->ifi_index, 0)); } } -- 2.30.2