public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Cc: Sven Eckelmann <sven@narfation.org>
Subject: [B.A.T.M.A.N.] [PATCH] batctl: Force \0 termination of string in bisect_iv
Date: Thu, 12 Jun 2014 18:33:43 +0200	[thread overview]
Message-ID: <1402590823-3605-1-git-send-email-sven@narfation.org> (raw)

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.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 bisect_iv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bisect_iv.c b/bisect_iv.c
index e5efb89..b748813 100644
--- a/bisect_iv.c
+++ b/bisect_iv.c
@@ -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;
 	}
-- 
2.0.0


             reply	other threads:[~2014-06-12 16:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-12 16:33 Sven Eckelmann [this message]
2014-06-14  1:54 ` [B.A.T.M.A.N.] [PATCH] batctl: Force \0 termination of string in bisect_iv Marek Lindner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1402590823-3605-1-git-send-email-sven@narfation.org \
    --to=sven@narfation.org \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox