From a6c8e0d9e99f1eb341d87df26b6fa02dc051f4a0 Mon Sep 17 00:00:00 2001 From: Justin Pettit Date: Mon, 21 Feb 2011 17:19:18 -0800 Subject: [PATCH] ovs-vsctl: Check "key" is valid before dereferencing in get_external_id(). Coverity #10716 --- utilities/ovs-vsctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.30.2