Browse Source

Merge pull request #9266 from jakesmith/hpcc-16518

HPCC-16518 Fix potentially hitting asserts in UDP/SNMP reports

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 8 years ago
parent
commit
da64f329cb
1 changed files with 4 additions and 2 deletions
  1. 4 2
      system/jlib/jdebug.cpp

+ 4 - 2
system/jlib/jdebug.cpp

@@ -2170,8 +2170,8 @@ public:
             {
                 unsigned queue = strtoul(cols.item(queueCol), NULL, 16);
                 unsigned drops = 0;
-                if (dropsCol)
-                    drops =  strtoul(cols.item(dropsCol), NULL, 10);
+                if (dropsCol >= 0)
+                    drops = strtoul(cols.item(dropsCol), NULL, 10);
                 if (queue || drops)
                 {
                     unsigned port = strtoul(cols.item(portCol), NULL, 16);
@@ -2243,6 +2243,8 @@ public:
                         if (streq(columnNames.item(idx), "InErrors"))
                             inErrorsCol = idx;
                     }
+                    if (inErrorsCol == -1)
+                        break;
                 }
                 if (fgets(ln, sizeof(ln), netfp))
                 {