GNU bug report logs -
#79336
[PATCH] df: fix potential null pointer dereference
Previous Next
Full log
View this message in rfc822 format
Paul Eggert <eggert <at> cs.ucla.edu> writes:
> On 2025-08-28 18:45, yubiao hu wrote:
>> * src/df.c (get_dev): Fix potential null pointer dereference
>> - Avoid dereferencing stat_file when both device and
>> mount_point are NULL
>> - Handle allocation failure for cell when mount_point
>> is NULL
>
> Why is this patch needed? Can you give an example df invocation in
> which mount_point is null there? As far as I can see, that cannot
> happen.
That was my understanding as well. Since preceding that section there
is:
/* If MOUNT_POINT is null, then the file system is not mounted, and this
program reports on the file system that the special file is on.
It would be better to report on the unmounted file system,
but statfs doesn't do that on most systems. */
if (!stat_file)
stat_file = mount_point ? mount_point : device;
I don't see why we would have a mount entry if both MOUNT_POINT and
DEVICE are NULL.
Collin
This bug report was last modified 9 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.