Attached input (only consisting of two bytes 00 ff) will result in an invalid memory read access. To see it you have to compile xmlif with address sanitizer (CFLAGS="-fsanitize=address").
Found with american fuzzy lop.
Address Sanitizer output: {{{ ==20701==ERROR: AddressSanitizer: global-buffer-overflow on address 0x00000040eb98 at pc 0x40a5fd bp 0x7fffbe27fb80 sp 0x7fffbe27fb70 READ of size 2 at 0x00000040eb98 thread T0 #0 0x40a5fc in yylex xmlif/xmlif.c:1417 #1 0x7f6ff4b6df9f in __libc_start_main (/lib64/libc.so.6+0x1ff9f) #2 0x401961 (/mnt/ram/xmlto/xmlif/xmlif+0x401961)
0x00000040eb98 is located 0 bytes to the right of global variable 'yy_transition' from 'xmlif/xmlif.c' (0x40b540) of size 13912 SUMMARY: AddressSanitizer: global-buffer-overflow xmlif/xmlif.c:1417 yylex Shadow bytes around the buggy address: 0x000080079d20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x000080079d30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x000080079d40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x000080079d50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x000080079d60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x000080079d70: 00 00 00[f9]f9 f9 f9 f9 00 00 00 00 00 00 00 00 0x000080079d80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x000080079d90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x000080079da0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x000080079db0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x000080079dc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Contiguous container OOB:fc ASan internal: fe ==20701==ABORTING }}}
attachment invalidread.xml
Confirmed, however I think the issue is probably in flex.
Metadata Update from @hanno: - Issue assigned to ovasik
I don't have a reproducer anymore, but since in the new release, we are upgrading Flex, and it was previously mentioned that Flex was the culprit, I think it's safe to say that it should be fixed upstream. However, if you can reproduce the issue with the newer version, please reopen the issue. Thank you.
Metadata Update from @osloup: - Issue close_status updated to: None - Issue status updated to: Closed (was: Open)