From d7f610d7769a34d38df63c9e0f24eff3891cf492 Mon Sep 17 00:00:00 2001 From: Martin Mathieson Date: Sun, 14 Jun 2020 11:48:27 +0100 Subject: [PATCH] rawshark: fix test to avoid reading beyond end of format string rawshark.c:1347:21: note: opposite inner condition: pos>=len if (pos >= len) { /* There should always be a following character */ Change-Id: I2e1c6b3d031db4f658bb579e0c8aba8cac7c5cb5 Reviewed-on: https://code.wireshark.org/review/37475 Petri-Dish: Martin Mathieson Tested-by: Petri Dish Buildbot Reviewed-by: Martin Mathieson --- rawshark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rawshark.c b/rawshark.c index 06cae3baf0..780b33a532 100644 --- a/rawshark.c +++ b/rawshark.c @@ -1344,7 +1344,7 @@ parse_field_string_format(gchar *format) { while (pos < len) { if (format[pos] == '%') { - if (pos >= len) { /* There should always be a following character */ + if (pos >= (len-1)) { /* There should always be a following specifier character */ return FALSE; } pos++;