Closed xeniagda closed 2 years ago
At https://github.com/piderman314/bardecoder/blob/d42a92f72a05a62f80dc556c5baca434c245313f/src/decode/qr/data.rs#L108, the ALPHANUMERIC array is accessed at index read_bits_u16(...) / 45. However if the chars variable is greater than 45 * 45 = 2025, the index will be invalid. While a QR-code with such content is invalid, the function should return a QRError specifying the error instead of panicking.
ALPHANUMERIC
read_bits_u16(...) / 45
chars
45 * 45 = 2025
QRError
Sounds reasonable. Fixed!
I'm afraid this is a duplicate of #37. But yeah glad to see it fixed :)
At https://github.com/piderman314/bardecoder/blob/d42a92f72a05a62f80dc556c5baca434c245313f/src/decode/qr/data.rs#L108, the
ALPHANUMERIC
array is accessed at indexread_bits_u16(...) / 45
. However if thechars
variable is greater than45 * 45 = 2025
, the index will be invalid. While a QR-code with such content is invalid, the function should return aQRError
specifying the error instead of panicking.