Don't check the same character twice in a row, check it and the next character.
authorGuy Harris <guy@alum.mit.edu>
Sun, 28 Dec 2014 10:18:05 +0000 (02:18 -0800)
committerGuy Harris <guy@alum.mit.edu>
Sun, 28 Dec 2014 10:19:27 +0000 (10:19 +0000)
Fixes Coverity CID 1260460.

Change-Id: Ic9ed109a863bcf20a5e67e4f52d628011f5e9ba5
Reviewed-on: https://code.wireshark.org/review/6087
Reviewed-by: Guy Harris <guy@alum.mit.edu>
text2pcap.c

index 84c7e0437b0034263303085858b07723088f565f..7cd67e44fb7580f8edb2f7d4b46b98560222dfd2 100644 (file)
@@ -1352,7 +1352,7 @@ parse_token (token_t token, char *str)
                     tmp_str[1] = pkt_lnstart[i*3+1];
                     tmp_str[2] = '\0';
                     /* it is a valid convertable string */
-                    if (!g_ascii_isxdigit(tmp_str[0]) || !g_ascii_isxdigit(tmp_str[0])) {
+                    if (!g_ascii_isxdigit(tmp_str[0]) || !g_ascii_isxdigit(tmp_str[1])) {
                         break;
                     }
                     s2[i] = (char)strtoul(tmp_str, (char **)NULL, 16);