diff --git a/ChangeLog b/ChangeLog index 8718c48..4870869 100755 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ - Add program exit in nfx.c after panic with correupt data file - Add missing size check when reading nfdump 1.5.x common record blocks - Add missing option -M in man page. Issue #103 +- Add Fix processing of influx URL in nfprofile 2018-02-11 - Add missing json output format in nfdump help text diff --git a/bin/nfprofile.c b/bin/nfprofile.c index a59bab0..738cd43 100644 --- a/bin/nfprofile.c +++ b/bin/nfprofile.c @@ -544,7 +544,7 @@ time_t tslot; // default file names ffile = "filter.txt"; rfile = NULL; - while ((c = getopt(argc, argv, "D:HIL:p:P:hif:J;r:n:M:S:t:VzZ")) != EOF) { + while ((c = getopt(argc, argv, "D:HIL:p:P:hi:f:J;r:n:M:S:t:VzZ")) != EOF) { switch (c) { case 'h': usage(argv[0]); @@ -613,8 +613,13 @@ time_t tslot; compress = LZO_COMPRESSED; break; #ifdef HAVE_INFLUXDB - case 'i': - strncpy(influxdb_url, optarg, 1024); + case 'i': + if ( optarg != NULL ) + strncpy(influxdb_url, optarg, 1024); + else { + LogError("Missing argument for -i \n"); + exit(255); + } influxdb_url[1023] = '\0'; break; #endif