Skip to contentSkip to conversation

batctl: Force \0 termination of string in bisect_iv

PATCH Applied Sven Eckelmann 2 participants 2 messages Jun 12, 2014 – Jun 14, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 batctl: Force \0 termination of string in bisect_iv

This is a part of patch 4faf653307789150f1d40383e95c85a086630378 ("batctl:
Force null termination of string after strncpy") but was forgotten before it was submitted to the maintainers.

---
 bisect_iv.c | 1 +
 1 file changed, 1 insertion(+)
bisect_iv.c +1 -0
index e5efb89..b748813 100644
@@ -365,6 +365,7 @@ static int routing_table_new(char *orig, char *next_hop, char *old_next_hop, cha
 	if ((rt_table->num_entries == 1) || (rt_table->num_entries != j + 1)) {
 		i = rt_table->num_entries;
 		strncpy(rt_table->entries[i - 1].orig, orig, NAME_LEN);
+		rt_table->entries[i - 1].orig[NAME_LEN - 1] = '\0';
 		rt_table->entries[i - 1].next_hop = next_hop_node;
 		rt_table->entries[i - 1].flags = rt_flag;
 	}
Signature · 1 line
2.0.0
#1 lore raw
Quoted 8 lines · On Thursday 12 June 2014 18:33:43 Sven Eckelmann wrote:

This is a part of patch 4faf653307789150f1d40383e95c85a086630378 ("batctl:
Force null termination of string after strncpy") but was forgotten before it was submitted to the maintainers.

---
 bisect_iv.c | 1 +
 1 file changed, 1 insertion(+)

Applied in revision c861e47.

Thanks,
Marek