diff --git a/src/net_helper.c b/src/net_helper.c index e71abd9b0..84e6b86d8 100644 --- a/src/net_helper.c +++ b/src/net_helper.c @@ -605,8 +605,8 @@ static int sample_conv_tcp_options_list(const struct arg *arg_p, struct sample * /* kind1 = NOP and is a single byte, others have a length field */ if (smp->data.u.str.area[ofs] == 1) ofs++; - else if (ofs + 1 < len) - ofs += smp->data.u.str.area[ofs + 1]; + else if (ofs + 1 < len && smp->data.u.str.area[ofs + 1]) + ofs += (uchar)smp->data.u.str.area[ofs + 1]; else break; }