summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_routemap.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-12-05 02:51:34 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-12-05 03:28:19 +0100
commit116e176d99e8dd5a586196feee3df3d8eebed0ee (patch)
treebf33b22491bcb4d7d9e1bc0e88086853dc1cb029 /bgpd/bgp_routemap.c
parentbgpd: Tell the compiler we don't care about the return code for peer_sort (diff)
downloadfrr-116e176d99e8dd5a586196feee3df3d8eebed0ee.tar.xz
frr-116e176d99e8dd5a586196feee3df3d8eebed0ee.zip
bgpd, zebra: Use sscanf return value
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'bgpd/bgp_routemap.c')
-rw-r--r--bgpd/bgp_routemap.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c
index 30397f848..8c9f9f65c 100644
--- a/bgpd/bgp_routemap.c
+++ b/bgpd/bgp_routemap.c
@@ -2082,7 +2082,10 @@ static void *route_set_aggregator_as_compile(const char *arg)
aggregator =
XCALLOC(MTYPE_ROUTE_MAP_COMPILED, sizeof(struct aggregator));
- sscanf(arg, "%s %s", as, address);
+ if (sscanf(arg, "%s %s", as, address) != 2) {
+ XFREE(MTYPE_ROUTE_MAP_COMPILED, aggregator);
+ return NULL;
+ }
aggregator->as = strtoul(as, NULL, 10);
ret = inet_aton(address, &aggregator->address);