daemon_vty: avoid null-dereference in argc < 0 case
in show_gtp_cmd, we have two different checks (argc > 0) vs (argc) which means in theory argc could be negative and the second clause would be executed without the first having set up related data such as 'ai'. Fixes: CID#307521: Explicit null dereferenced (FORWARD_NULL) Change-Id: I4149b0b191a34168ba6649338d3cdf6c6af6cfe7
This commit is contained in:
parent
3f2361ee33
commit
e36dbcbc03
|
@ -145,7 +145,7 @@ DEFUN(show_gtp, show_gtp_cmd,
|
|||
|
||||
show_ep_hdr(vty);
|
||||
pthread_rwlock_rdlock(&g_daemon->rwlock);
|
||||
if (argc) {
|
||||
if (argc > 0) {
|
||||
ep = _gtp_endpoint_find(g_daemon, (const struct sockaddr_storage *) ai->ai_addr);
|
||||
if (!ep) {
|
||||
pthread_rwlock_unlock(&g_daemon->rwlock);
|
||||
|
|
Loading…
Reference in New Issue