diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-11-02 14:22:32 -0500 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2014-11-02 14:22:32 -0500 |
commit | 66498b0110dc8966a1d98a450249de26559fd495 (patch) | |
tree | 3dd000ef6273912c0db7864f2a37264cebb66b68 /src/libudev/libudev.c | |
parent | 27756785c2303998f3cd2e24885085d1feff348d (diff) |
libudev: do not accept invalid log levels
Invalid log levels lead to a assert failure later on.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/libudev/libudev.c')
-rw-r--r-- | src/libudev/libudev.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libudev/libudev.c b/src/libudev/libudev.c index beb9a65481..5d3ad50411 100644 --- a/src/libudev/libudev.c +++ b/src/libudev/libudev.c @@ -192,7 +192,13 @@ _public_ struct udev *udev_new(void) } if (streq(key, "udev_log")) { - udev_set_log_priority(udev, util_log_priority(val)); + int prio; + + prio = util_log_priority(val); + if (prio < 0) + udev_err(udev, "/etc/udev/udev.conf:%u: invalid logging level '%s', ignoring.\n", line_nr, val); + else + udev_set_log_priority(udev, prio); continue; } } |