Menu

#104 Crash with QR Code + GS1 + % chars

1.0
closed
None
2018-11-02
2018-06-19
No

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.

Discussion

  • Robin Stuart

    Robin Stuart - 2018-06-20

    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.

     
  • Robin Stuart

    Robin Stuart - 2018-06-21
    • status: open --> accepted
    • assigned_to: Robin Stuart
     
  • Robin Stuart

    Robin Stuart - 2018-06-21

    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.

     
  • Daniel Gredler

    Daniel Gredler - 2018-06-27

    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?

     
  • Harald Oehlmann

    Harald Oehlmann - 2018-11-02
    • status: accepted --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB