diff options
author | NRK <nrk@disroot.org> | 2022-07-03 12:45:50 +0200 |
---|---|---|
committer | NRK <nrk@disroot.org> | 2022-07-03 12:45:50 +0200 |
commit | 51d4c8dd4f793114cbc520f2a8465981bd1d4eaa (patch) | |
tree | a56c9062320425f33c67bf142143c803d19ce8d3 /exec/image-info | |
parent | 7c59cc7edc138e66c20837107a7021676e65be29 (diff) |
check for utf8_decode errors (#327)
utf8_decode() may return an errors, in which case the returned codepoint
might be garbage. the issue can be tested by adding the following to
`image-info` which produces invalid utf8 sequences:
base64 -d << EOF
9JCAgPSQgIH0kICC9JCAg/SQgIT0kICF9JCAhvSQgIf0kICI9JCAifSQgIr0kICL9JCAjPSQgI30
kICO9JCAj/SQgJD0kICR9JCAkvSQgJP0kICU9JCAlfSQgJb0kICX9JCAmPSQgJn0kICa9JCAm/SQ
gJz0kICd9JCAnvSQgJ8=
EOF
on my system, this leads to the statusbar being filled with empty boxes.
check for returned error and skip the iteration.
Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/327
Reviewed-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
Diffstat (limited to 'exec/image-info')
0 files changed, 0 insertions, 0 deletions