diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2017-06-15 16:22:42 +0200 |
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2017-06-15 16:22:42 +0200 |
| commit | f43cd318b26a3dc57a0e6f40bcccdd5ce1886432 (patch) | |
| tree | eed2449282c488b77e1dc45b0e10c7d2ab34c45b /ospfclient/ospfclient.c | |
| parent | ffef22509f2a0aafcfecd56f00d75917e9139dc5 (diff) | |
| parent | 68fc8f1f26e44aaaac9b39421519863e5b18bc7a (diff) | |
Merge pull request #711 ("Coverity munging")
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'ospfclient/ospfclient.c')
| -rw-r--r-- | ospfclient/ospfclient.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/ospfclient/ospfclient.c b/ospfclient/ospfclient.c index 195fd5b5a0..d8d0fe8d47 100644 --- a/ospfclient/ospfclient.c +++ b/ospfclient/ospfclient.c @@ -94,7 +94,12 @@ lsa_delete (struct thread *t) oclient = THREAD_ARG (t); - inet_aton (args[6], &area_id); + rc = inet_aton (args[6], &area_id); + if (rc <= 0) + { + printf("Address Specified: %s is invalid\n", args[6]); + return rc; + } printf ("Deleting LSA... "); rc = ospf_apiclient_lsa_delete (oclient, @@ -123,8 +128,19 @@ lsa_inject (struct thread *t) cl = THREAD_ARG (t); - inet_aton (args[5], &ifaddr); - inet_aton (args[6], &area_id); + rc = inet_aton (args[5], &ifaddr); + if (rc <= 0) + { + printf ("Ifaddr specified %s is invalid\n", args[5]); + return rc; + } + + rc = inet_aton (args[6], &area_id); + if (rc <= 0) + { + printf( "Area ID specified %s is invalid\n", args[6]); + return rc; + } lsa_type = atoi (args[2]); opaque_type = atoi (args[3]); opaque_id = atoi (args[4]); |
