]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
decode: fix integer warning 7455/head
authorPhilippe Antoine <contact@catenacyber.fr>
Mon, 2 May 2022 11:30:35 +0000 (13:30 +0200)
committerVictor Julien <vjulien@oisf.net>
Wed, 1 Jun 2022 08:59:02 +0000 (10:59 +0200)
Newly introduced warning.
Regular cast as value is checked just before.

Ticket: #4516

src/decode.c

index c29d2827dd11fd7b130dc40f5a48b74c826c4d7c..c87941ff80bc0cafc45767db801d4ac8451219e5 100644 (file)
@@ -814,7 +814,7 @@ void PacketAlertGetMaxConfig(void)
             SCLogWarning(SC_ERR_INVALID_VALUE,
                     "Invalid value for packet-alert-max, default value set instead");
         } else {
-            packet_alert_max = max;
+            packet_alert_max = (uint16_t)max;
         }
     }
     SCLogDebug("detect->packet_alert_max set to %d", packet_alert_max);