Repositories
/
olsrd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f5ce3dc
)
txtinfo: ensure null termination of string buffer
author
Ferry Huberts
<ferry.huberts@pelagic.nl>
Fri, 24 Oct 2014 07:51:41 +0000
(09:51 +0200)
committer
Ferry Huberts
<ferry.huberts@pelagic.nl>
Fri, 24 Oct 2014 07:55:55 +0000
(09:55 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/txtinfo/src/olsrd_txtinfo.c
patch
|
blob
|
history
diff --git
a/lib/txtinfo/src/olsrd_txtinfo.c
b/lib/txtinfo/src/olsrd_txtinfo.c
index
02bd00a
..
23479d0
100644
(file)
--- a/
lib/txtinfo/src/olsrd_txtinfo.c
+++ b/
lib/txtinfo/src/olsrd_txtinfo.c
@@
-567,6
+567,7
@@
static void sgw_ipvx(struct autobuf *abuf, bool ipv6, const char * fmth, const c
inet_ntop(ipv6 ? AF_INET6 : AF_INET, &gw->gw->originator, originator, sizeof(originator));
strncpy(prefix, olsr_ip_prefix_to_string(&gw->gw->external_prefix), sizeof(prefix));
+ prefix[sizeof(prefix) - 1] = '\0';
uplink = gw->gw->uplink;
downlink = gw->gw->downlink;
pc = tc ?tc->path_cost : ROUTE_COST_BROKEN;