Avoid negative overflow when the text output driver tries to print
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 20 Jun 2020 05:17:06 +0000 (07:17 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sat, 20 Jun 2020 05:18:19 +0000 (07:18 +0200)
commit7005ff151eefdd9d2650dcfd0450e367eaad92aa
treece6d2e8701321781f6112e009687b25c3136c44c
parentdde8f7a5273ebd1fe9e6fa5c99f378f9651bb192
Avoid negative overflow when the text output driver tries to print
random binary data.

libpspp/u8-line.c (u8_line_find_pos): Deal properly with the case
where the target is not found in the search string.

libpspp/u8-line.c (u8_line_reserve): Add some assertions to prevent
negative overflow into lower function calls.

Reported by: Andrea Fioraldi

Fixes bug: #58591
src/libpspp/u8-line.c