chiark / gitweb /
convert debug string arrays to functions
authorKay Sievers <kay.sievers@vrfy.org>
Fri, 7 Nov 2008 14:59:58 +0000 (15:59 +0100)
committerKay Sievers <kay.sievers@vrfy.org>
Fri, 7 Nov 2008 14:59:58 +0000 (15:59 +0100)
commit5d6a1fa6e92b9760c243725ea543ade85b8b2b79
tree0602566709de72274c60200ed43fdecdc956b2f3
parente230e966f44c0ebb4954cbd30740384e14c1ca0f
convert debug string arrays to functions

On Fri, Nov 7, 2008 at 13:07, Matthias Schwarzott <zzam@gentoo.org> wrote:
> I managed to let udev-131 segfault at startup.
>
> I configured it like this:
> CFLAGS="-Wall -ggdb" ./configure --prefix=/usr --sysconfdir=/etc --exec-prefix=
>
> Running it in gdb shows it segfaults at udev-rules.c:831
>
> (gdb) run
> Starting program: /tmp/udev-131/udev/udevd
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x0804ea06 in get_key (udev=0x9175008, line=0xafcdc8f0, key=0xafcdc5d8,
> op=0xafcdc5d0, value=0xafcdc5d4)
>    at udev-rules.c:831
> 831             dbg(udev, "%s '%s'-'%s'\n", operation_str[*op], *key, *value);

If compiled without optimization, the dbg() macro dereferences variables
which are not available. Convert the string array to a function, which just
returns NULL if compiled without DEBUG.
udev/udev-rules.c