grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 2/3] osdep/unix/getroot.c: Clean up redundant code


From: Daniel Kiper
Subject: Re: [PATCH 2/3] osdep/unix/getroot.c: Clean up redundant code
Date: Tue, 23 Jan 2024 15:42:45 +0100
User-agent: NeoMutt/20170113 (1.7.2)

Mate,

Next time please respond to all people/addresses in the original
email...

On Mon, Jan 22, 2024 at 02:09:38PM +0000, Mate Kukri wrote:
> Dear Alec, and grub-devel,
>
> I haven't checked the specific code in question, but do we really want
> to be removing such null-assignments? (Thinking about multiple patches
> exactly like this).
>
> In correct code, they are of course redundant by definition, however
> their intended purpose is that if the code happens to be incorrect,
> they turn use-after-free bugs into zero page accesses.
>
> Since static analysis of a language like C is inherently conservative,
> it is entirely possible that it is detecting the redundant assignment,
> but not the use after free it would have prevented.

We know the Coverity makes mistakes. So, we carefully check its reports.
These ones are not exceptions. Here the Coverity is correct and it is
safe to remove redundant code. I expect somebody was changing the code
at some point and forgot to drop surplus assignments.

Daniel



reply via email to

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