#46 Decoder crashes on illegal ASCII shift sequences

version 0.7.2
open
Mike Laughton
decoding (11)
5
2014-05-21
2010-07-28
Mike Laughton
No

The libdmtx decoder can crash when encountering illegal ASCII shift sequences instead of exiting gracefully with an appropriate error message:

$ dmtxread -v /tmp/iec16022-milan-auto.png
dmtxread: dmtxdecode.c:628: PushOutputWord: Assertion `value >= 0 && value < 256' failed.

This bug shouldn't affect correctly formed barcodes, but can arise when barcodes contain illegal sequences or incorrect Base 256 lengths.

Discussion

  • dobiasd
    dobiasd
    2013-12-02

    Just ran into this issue with some images.

    At the moment I just commented out line 204 in dmtxdecodescheme.c (//upperShift = DmtxTrue;).

    Is there a better fix/workaround for this?

     
  • I just encountered this as well. This took down our tomcat server since we're using dmtx with the Java wrapper. Does anyone here have any suggestions for trapping this error within Java? Unfortunately my experience with using c-libs from Java is limited.