From: John Ferlan Date: Wed, 13 May 2015 15:10:47 +0000 (-0400) Subject: network: Resolve Coverity FORWARD_NULL X-Git-Tag: v1.2.16-rc1~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=38f0fc19af92051256664bae78ee8679cc9c926c;p=thirdparty%2Flibvirt.git network: Resolve Coverity FORWARD_NULL 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 --- diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 4b5347513e..f438c0b49b 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -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 {