]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
src/rrd_fetch_libdbi.c: fix Coverity CID#13634 Logically dead code
authorMarek Schimara <Marek.Schimara@bull.net>
Fri, 17 Jun 2016 11:19:43 +0000 (13:19 +0200)
committerMarek Schimara <Marek.Schimara@bull.net>
Thu, 23 Jun 2016 14:32:33 +0000 (16:32 +0200)
        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.

src/rrd_fetch_libdbi.c

index fc183c7fe4050c088361266fc7bf55979f50a6e9..8a868efc6084c0d88684bd696c2ac1f972f55eff 100644 (file)
@@ -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);
        }