ciscodump: fix line parsing and fix memleak.
authorDario Lombardo <lomato@gmail.com>
Tue, 6 Sep 2016 12:42:29 +0000 (14:42 +0200)
committerPeter Wu <peter@lekensteyn.nl>
Tue, 6 Sep 2016 19:58:26 +0000 (19:58 +0000)
Change-Id: I4aee51d7def06317a543fdc8fa05120af0e68453
Reviewed-on: https://code.wireshark.org/review/17531
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
extcap/ciscodump.c

index 619b930373fde4e64910815588bcb15a05749a04..eae0edb90dfcb11d23efa506b5596316fbb7e431 100644 (file)
@@ -208,7 +208,7 @@ static int parse_line(char* packet _U_, unsigned* offset, char* line, int status
        /* ABCDEF01: 01020304 05060708 090A0B0C 0D0E0F10 ................                       */
        /* Note that any of the 4 groups are optional and that a group can be 1 to 4 bytes long */
        parts = g_regex_split_simple(
        /* ABCDEF01: 01020304 05060708 090A0B0C 0D0E0F10 ................                       */
        /* Note that any of the 4 groups are optional and that a group can be 1 to 4 bytes long */
        parts = g_regex_split_simple(
-               "^[\\dA-Z]{8,8}:\\s+([\\dA-Z]{2,8})\\s+([\\dA-Z]{2,8}){0,1}\\s+([\\dA-Z]{2,8}){0,1}\\s+([\\dA-Z]{2,8}){0,1}.*",
+               "^[\\dA-F]{8,8}:\\s+([\\dA-F]{2,8})\\s+([\\dA-F]{2,8}){0,1}\\s+([\\dA-F]{2,8}){0,1}\\s+([\\dA-F]{2,8}){0,1}.*",
                line, G_REGEX_CASELESS, G_REGEX_MATCH_ANCHORED);
 
        part = parts;
                line, G_REGEX_CASELESS, G_REGEX_MATCH_ANCHORED);
 
        part = parts;
@@ -222,6 +222,7 @@ static int parse_line(char* packet _U_, unsigned* offset, char* line, int status
                }
                part++;
        }
                }
                part++;
        }
+       g_strfreev(parts);
        return CISCODUMP_PARSER_IN_PACKET;
 }
 
        return CISCODUMP_PARSER_IN_PACKET;
 }