On Tue, Apr 09, 2024 at 01:31:01PM +0200, Phil Sutter wrote: > Calling iptables with '-c ""' resulted in a call to strchr() with an > invalid pointer as 'optarg + 1' points to past the buffer. The most > simple fix is to drop the offset: The global optstring part specifies a > single colon after 'c', so getopt() enforces a valid pointer in optarg. > If it contains a comma at first position, packet counter value parsing > will fail so all cases are covered. > > Reported-by: gorbanev.es@xxxxxxxxx > Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1741 > Fixes: 60a6073690a45 ("Make --set-counters (-c) accept comma separated counters") > Signed-off-by: Phil Sutter <phil@xxxxxx> Patch applied.