Skip to content

Commit

Permalink
protect against NULL collector name
Browse files Browse the repository at this point in the history
  • Loading branch information
sflow committed Apr 6, 2020
1 parent 3d3d079 commit 7fa3363
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion hsflowd.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Summary: host sFlow daemon
Name: hsflowd
Version: 2.0.26
Release: 4
Release: 5
License: http://sflow.net/license.html
Group: Applications/Internet
URL: http://sflow.net
Expand Down
8 changes: 5 additions & 3 deletions src/Linux/mod_sonic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1054,9 +1054,11 @@ extern "C" {
char *pcmem = parseNextTok(&p, "|", YES, 0, NO, buf, HSP_SONIC_MAX_COLLECTORNAME_LEN);
if(my_strequal(pcmem, "SFLOW_COLLECTOR")) {
char *collectorName = parseNextTok(&p, "|", YES, 0, NO, buf, HSP_SONIC_MAX_COLLECTORNAME_LEN);
HSPSonicCollector *coll = getCollector(mod, collectorName, YES);
coll->mark = NO;
UTArrayPush(mdata->newCollectors, coll);
if(collectorName) {
HSPSonicCollector *coll = getCollector(mod, collectorName, YES);
coll->mark = NO;
UTArrayPush(mdata->newCollectors, coll);
}
}
}
}
Expand Down

0 comments on commit 7fa3363

Please sign in to comment.