From e68893075083a7461b1572233d23fdb23541d630 Mon Sep 17 00:00:00 2001 From: Michael Terry Date: Fri, 14 Dec 2012 09:02:13 -0500 Subject: [PATCH] libudev: validate 'udev' argument to udev_enumerate_new() https://bugs.freedesktop.org/show_bug.cgi?id=58289 --- src/libudev/libudev-enumerate.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) Index: systemd-195/src/libudev/libudev-enumerate.c =================================================================== --- systemd-195.orig/src/libudev/libudev-enumerate.c +++ systemd-195/src/libudev/libudev-enumerate.c @@ -73,6 +73,8 @@ _public_ struct udev_enumerate *udev_enu { struct udev_enumerate *udev_enumerate; + if (udev == NULL) + return NULL; udev_enumerate = calloc(1, sizeof(struct udev_enumerate)); if (udev_enumerate == NULL) return NULL;