]> git.ipfire.org Git - thirdparty/cups.git/commit
Fix UB in cups_raster_read debug message 607/head
authorBenjamin Gordon <bmgordon@chromium.org>
Wed, 1 Feb 2023 17:01:42 +0000 (10:01 -0700)
committerBenjamin Gordon <bmgordon@chromium.org>
Wed, 1 Feb 2023 17:01:42 +0000 (10:01 -0700)
commitfd792e33adf680bf5872b717372e17d46772386d
treec0a582a874345093c00b6378c355ff82f9f6029b
parentd616562ffa08c991b4144615a36b62b033b79172
Fix UB in cups_raster_read debug message

The first time `cups_raster_read` is called, both `r->bufptr` and
`r->buffer` are NULL.  The calculation here then ends up looking like
adding a size_t to a NULL pointer, which triggers the ubsan detector.
Since we just want an offset, cast the pointer difference to ssize_t
like the code already does a few lines below.
cups/raster-stream.c