Debian Patches

Status for libldm/0.2.5-2

Patch Description Author Forwarded Bugs Origin Last update
0001-ldmtool-fix-NULL-pointer-dereference.patch ldmtool: fix NULL pointer dereference
If /sys/block can not be opened, get_devices() returns NULL.

cmdline() does not check this result and below code snippet:

scanned = get_devices();
devices = (gchar **) scanned->data;

results in a segmentation fault.

Add a check on scanned.

Relevant logs:

Unable to open /sys/block: No such file or directory
[ 0.777352] ldmtool[164]: segfault at 0 ip 0000563a225cd6a5 sp 00007ffe54965a60 error 4 in ldmtool[563a225cb000+3000]
[ 0.778278] Code: 18 64 48 33 1c 25 28 00 00 00 75 5e 48 83 c4 28 5b 5d 41 5c 41 5d 41 5e 41 5f c3 66 2e 0f 1f 84 00 00 00 00 00 e8 db fd ff ff <4c> 8b 20 48 89 44 24 08 4c 89 e7 e8 0b e1 ff ff 45 31 c0 4c 89 e1
Vincent Mailhol <mailhol.vincent@wanadoo.fr> no 2023-06-20
0002-src-Fix-declaration-of-ldm_new.patch src: Fix declaration of ldm_new
GCC 15 forbids declaring a function with () instead of (void).
Declaring it properly reveals an actual bug in ldmtool.

ldmtool.c: In function ‘main’:
ldmtool.c:859:23: error: too many arguments to function ‘ldm_new’; expected 0, have 1
859 | LDM * const ldm = ldm_new(&err);
| ^~~~~~~ ~~~~
In file included from ldmtool.c:38:
ldm.h:259:6: note: declared here
259 | LDM *ldm_new();
| ^~~~~~~
"Richard W.M. Jones" <rjones@redhat.com> no 2025-02-06

All known versions for source package 'libldm'

Links