diff options
author | Igor Kozhukhov <igork@argotech.io> | 2016-09-06 23:54:34 +0300 |
---|---|---|
committer | Robert Mustacchi <rm@joyent.com> | 2016-09-07 10:00:34 -0700 |
commit | c985e172447301fefddd2d30ac4cb0cac2281d0c (patch) | |
tree | e6901b9c00e6d309f751474792a52b34c5016f32 /usr/src | |
parent | 31d4cf520a749c6f68cc90540de415399538680b (diff) | |
download | illumos-joyent-c985e172447301fefddd2d30ac4cb0cac2281d0c.tar.gz |
7359 NULL pointer at strcmp() in ipmgmt_nvlist_match()
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/cmd/cmd-inet/lib/ipmgmtd/ipmgmt_persist.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr/src/cmd/cmd-inet/lib/ipmgmtd/ipmgmt_persist.c b/usr/src/cmd/cmd-inet/lib/ipmgmtd/ipmgmt_persist.c index 73a0c621d0..09fe54e5ac 100644 --- a/usr/src/cmd/cmd-inet/lib/ipmgmtd/ipmgmt_persist.c +++ b/usr/src/cmd/cmd-inet/lib/ipmgmtd/ipmgmt_persist.c @@ -21,6 +21,7 @@ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2016 Argo Technologie SA. */ /* @@ -111,19 +112,22 @@ ipmgmt_nvlist_match(nvlist_t *db_nvl, const char *proto, const char *ifname, if ((proto == NULL && db_proto != NULL) || (proto != NULL && db_proto == NULL) || - strcmp(proto, db_proto) != 0) { + (proto != NULL && db_proto != NULL && + strcmp(proto, db_proto) != 0)) { /* no intersection - different protocols. */ return (B_FALSE); } if ((ifname == NULL && db_ifname != NULL) || (ifname != NULL && db_ifname == NULL) || - strcmp(ifname, db_ifname) != 0) { + (ifname != NULL && db_ifname != NULL && + strcmp(ifname, db_ifname) != 0)) { /* no intersection - different interfaces. */ return (B_FALSE); } if ((aobjname == NULL && db_aobjname != NULL) || (aobjname != NULL && db_aobjname == NULL) || - strcmp(aobjname, db_aobjname) != 0) { + (aobjname != NULL && db_aobjname != NULL && + strcmp(aobjname, db_aobjname) != 0)) { /* no intersection - different address objects */ return (B_FALSE); } |