From: Ethan Jackson Date: Tue, 1 Feb 2011 06:45:58 +0000 (-0800) Subject: lib: Fix off-by-one error in route-table. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fca2ffb3a05ed8f04121781a56c75e80611b6f8d;p=openvswitch lib: Fix off-by-one error in route-table. --- 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)); } }