]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
network: Resolve Coverity FORWARD_NULL
authorJohn Ferlan <jferlan@redhat.com>
Wed, 13 May 2015 15:10:47 +0000 (11:10 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Sun, 24 May 2015 11:01:48 +0000 (07:01 -0400)
To silence Coverity just add a 'p &&' in front of the check in
networkFindUnusedBridgeName after the strchr() call.  Even though
we know it's not possible to have strchr return NULL since the only
way into the function is if there is a '%' in def->bridge or it's NULL.

Signed-off-by: John Ferlan <jferlan@redhat.com>
src/network/bridge_driver.c

index 4b5347513eb7887b7d60dc07acbbd4668dc507ef..f438c0b49b309e0517bceb051feabb5bc712d2cd 100644 (file)
@@ -2780,7 +2780,7 @@ networkFindUnusedBridgeName(virNetworkObjListPtr nets,
 
     if (def->bridge &&
         (p = strchr(def->bridge, '%')) == strrchr(def->bridge, '%') &&
-        p[1] == 'd')
+        p && p[1] == 'd')
         templ = def->bridge;
 
     do {