text_import: gracefully handle hexdump without trailing LF

Adjust the grammar to recognize two trailing hexadecimal characters
without a LF as a byte as well. Ported from text2pcap and commit
22cf80d30d which explains why this
is safe. More work for #16724.
This commit is contained in:
John Thacker 2021-12-22 14:39:25 -05:00 committed by Wireshark GitLab Utility
parent 1b5acc8d57
commit 50d66b6346
1 changed files with 1 additions and 2 deletions

View File

@ -99,10 +99,9 @@ DIAG_OFF_FLEX
%}
hexdigit [0-9A-Fa-f]
directive ^#TEXT2PCAP.*\r?\n
comment ^[\t ]*#.*\r?\n
byte [0-9A-Fa-f][0-9A-Fa-f][ \t]
byte [0-9A-Fa-f][0-9A-Fa-f][ \t]?
byte_eol [0-9A-Fa-f][0-9A-Fa-f]\r?\n
offset [0-9A-Fa-f]+[: \t]
offset_eol [0-9A-Fa-f]+\r?\n