From: Marek Schimara Date: Fri, 17 Jun 2016 11:19:43 +0000 (+0200) Subject: src/rrd_fetch_libdbi.c: fix Coverity CID#13634 Logically dead code X-Git-Tag: v1.7.0~42^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6b16ce14aa04781bafa2d92e35b52868d0ec4d5f;p=thirdparty%2Frrdtool-1.x.git src/rrd_fetch_libdbi.c: fix Coverity CID#13634 Logically dead code CWE-561 / https://cwe.mitre.org/data/definitions/561.html NOTE: this seems like a copy & paste error; either we compare 'h1' to (char)-1 in which case the code cannot be reached (the same test is already done & it returns from the function), or (more likely) it should be 'h2' instead. --- diff --git a/src/rrd_fetch_libdbi.c b/src/rrd_fetch_libdbi.c index fc183c7f..8a868efc 100644 --- a/src/rrd_fetch_libdbi.c +++ b/src/rrd_fetch_libdbi.c @@ -363,7 +363,7 @@ static int _inline_unescape (char* string) { return(1); } h2=_hexcharhelper(*(src+1)); - if (h1 == (char)-1) { + if (h2 == (char)-1) { rrd_set_error("string escape error at: %s\n",string); return(1); }