lib: Fix off-by-one error in route-table.
authorEthan Jackson <ethan@nicira.com>
Tue, 1 Feb 2011 06:45:58 +0000 (22:45 -0800)
committerEthan Jackson <ethan@nicira.com>
Tue, 1 Feb 2011 18:30:55 +0000 (10:30 -0800)
lib/route-table.c

index 29d81bb39bba7fe375ba92a3a5970f8e10ecc3a2..64a5c1e9ba388a389e1810fe54b1a436acc6fb9d 100644 (file)
@@ -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));
         }
     }