From: Rose <83477269+AtariDreams@users.noreply.github.com> Date: Sun, 23 Apr 2023 16:25:39 +0000 (-0400) Subject: UBSan: Contain pos - fp->bufpos in parentheses X-Git-Tag: v2.4.3~32^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd7846e30974d4a4d6d22052da5a6bf864e3b6fe;p=thirdparty%2Fcups.git UBSan: Contain pos - fp->bufpos in parentheses Yes I know this shouldn't change the behavior in theory, but clang insists it does in practice, so to quiet the UBSan, I put parentheses around pos - fp->bufpos. --- diff --git a/cups/file.c b/cups/file.c index 2fd0780804..ead31aab5f 100644 --- a/cups/file.c +++ b/cups/file.c @@ -1825,7 +1825,7 @@ cupsFileSeek(cups_file_t *fp, /* I - CUPS file */ */ fp->pos = pos; - fp->ptr = fp->buf + pos - fp->bufpos; + fp->ptr = fp->buf + (pos - fp->bufpos); fp->eof = 0; return (pos);