From: Justin Pettit Date: Tue, 22 Feb 2011 01:19:18 +0000 (-0800) Subject: ovs-vsctl: Check "key" is valid before dereferencing in get_external_id(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6c8e0d9e99f1eb341d87df26b6fa02dc051f4a0;p=openvswitch ovs-vsctl: Check "key" is valid before dereferencing in get_external_id(). Coverity #10716 --- diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c index 31c485ba..9fca1c8e 100644 --- a/utilities/ovs-vsctl.c +++ b/utilities/ovs-vsctl.c @@ -1403,7 +1403,7 @@ get_external_id(char **keys, char **values, size_t n, if (!key && !strncmp(keys[i], prefix, prefix_len)) { svec_add_nocopy(&svec, xasprintf("%s=%s", keys[i] + prefix_len, values[i])); - } else if (key_matches(keys[i], prefix, prefix_len, key)) { + } else if (key && key_matches(keys[i], prefix, prefix_len, key)) { svec_add(&svec, values[i]); break; }