]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
src/rrd_fetch_libdbi.c: fix Coverity CID#13630 Unchecked return value
authorMarek Schimara <Marek.Schimara@bull.net>
Fri, 17 Jun 2016 11:27:07 +0000 (13:27 +0200)
committerMarek Schimara <Marek.Schimara@bull.net>
Thu, 23 Jun 2016 14:32:33 +0000 (16:32 +0200)
        CWE-252 / https://cwe.mitre.org/data/definitions/252.html

src/rrd_fetch_libdbi.c

index 8a868efc6084c0d88684bd696c2ac1f972f55eff..895abec9c5c5b34e68816853eeab122b3a5c4e52 100644 (file)
@@ -250,7 +250,10 @@ static int _sql_fetchrow(struct sql_table_helper* th,time_t *timestamp, rrd_valu
     /* calculate the table to use next */
     th->table_start=th->table_next;
     th->table_next=_find_next_separator(th->table_start,'+');
-    _inline_unescape(th->table_start);
+    if (_inline_unescape(th->table_start)) {
+      _sql_close(th);
+      return -1;
+    }
     /* and prepare FULL SQL Statement */
     if (ordered) {
       snprintf(sql,sizeof(sql)-1,"SELECT %s as rrd_time, %s as rrd_value FROM %s WHERE %s ORDER BY %s",