bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#72245: [PATCH] Fix integer overflow when reading XPM


From: Stefan Kangas
Subject: bug#72245: [PATCH] Fix integer overflow when reading XPM
Date: Mon, 22 Jul 2024 08:48:25 -0700

Paul Eggert <eggert@cs.ucla.edu> writes:

> On 2024-07-22 08:01, Eli Zaretskii wrote:
>> +  if (p == *buf || errno == ERANGE || errno == EINVAL
>
> This should be:
>
>     if (errno || p == *buf
>
> as other errors are possible at least in theory, and p might be
> uninitialized on error.
>
>>> +  return (int)result;
>
> As a style matter this cast does more harm than good, as it will
> suppress a static check if 'result' happens to be a pointer type, and it
> could suppress a dynamic check on some debugging-oriented systems. I
> would say just 'return result;'.

Thanks for reviewing.

I've attached an updated patch with your proposed changes.

Attachment: 0001-Fix-integer-overflow-when-reading-XPM.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]