This avoids a potential casting to uint64_t of -1, leading to a very
high upper bound of the tx loop.
HtpState *http_state = (HtpState *)alstate;
if (http_state != NULL && http_state->conn != NULL) {
- const uint64_t size = (uint64_t)htp_list_size(http_state->conn->transactions);
+ const int64_t size = (int64_t)htp_list_size(http_state->conn->transactions);
+ if (size < 0)
+ return 0ULL;
SCLogDebug("size %"PRIu64, size);
- return size;
+ return (uint64_t)size;
} else {
return 0ULL;
}