A port value of 65535 caused the port value to wrap-around to 0
resulting in an infinite loop.
Fixes: 53fc70a9a73c ("protodetect: fix int warnings")
uint16_t port = temp_dp->port;
if (port == 0 && temp_dp->port2 != 0)
port++;
- for ( ; port <= temp_dp->port2; port++) {
+ for (;;) {
AppLayerProtoDetectInsertNewProbingParser(&alpd_ctx.ctx_pp,
ipproto,
port,
direction,
ProbingParser1,
ProbingParser2);
+ if (port == temp_dp->port2) {
+ break;
+ } else {
+ port++;
+ }
}
temp_dp = temp_dp->next;
}