The following input string crashes Zint 2.6.3-win32 when encoding with QR Code and GS1:
[240]A%C%%F[241]A%%DE[243]%%%
I think there are some issues with tracking character count in some scenarios, possibly some issues around losing trailing data (final odd char), and length calculations which may not take into account the % -> %% expansion when in alphanumeric mode.
Thank you, Daniel.
I have added a check for this in getBinaryLength() so that enough memory should now be allocated, no matter how many % characters are in the input data. This stops the crashing but I still need to check if the data is being encoded properly.
Robin.
Hi Daniel,
I think I now have this sorted out - I have adjusted the character count indicator to include the "extra" percentages (qr_binary, starting at line 272), and this seems to scan properly with the limited testing I've done. The ISO standard seems to be a bit ambiguous about the proper way to handle this so I would appreciate any feedback you can give from your own testing.
Robin.
I think some of the new code is expanding % to %% even when GS1 mode is not enabled; I think the extra space should only be allocated when in GS1 mode, no?