From: Victor Julien Date: Thu, 9 Aug 2012 14:59:49 +0000 (+0200) Subject: Bug #510. Produce error if max-pending-packets is higher than 65534. X-Git-Tag: suricata-1.3.1~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fremotes%2Forigin%2FHEAD;p=thirdparty%2Fsuricata.git Bug #510. Produce error if max-pending-packets is higher than 65534. --- diff --git a/src/suricata.c b/src/suricata.c index 29e715c1af..0ae3719452 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -1326,6 +1326,13 @@ int main(int argc, char **argv) * back on a sane default. */ if (ConfGetInt("max-pending-packets", &max_pending_packets) != 1) max_pending_packets = DEFAULT_MAX_PENDING_PACKETS; + if (max_pending_packets >= 65535) { + SCLogError(SC_ERR_INVALID_YAML_CONF_ENTRY, + "Maximum max-pending-packets setting is 65534. " + "Please check %s for errors", conf_filename); + exit(EXIT_FAILURE); + } + SCLogDebug("Max pending packets set to %"PRIiMAX, max_pending_packets); /* Pull the default packet size from the config, if not found fall