summaryrefslogtreecommitdiff
path: root/src/libudev
diff options
context:
space:
mode:
authorMichael Terry <michael.terry@canonical.com>2012-12-14 09:02:13 -0500
committerKay Sievers <kay@vrfy.org>2012-12-14 15:36:47 +0100
commite68893075083a7461b1572233d23fdb23541d630 (patch)
treee6a4482dfc4d48cd994dc7525c14287863570994 /src/libudev
parent7a14d67f7618787a0b829eb360b41a3889801f74 (diff)
libudev: validate 'udev' argument to udev_enumerate_new()
https://bugs.freedesktop.org/show_bug.cgi?id=58289
Diffstat (limited to 'src/libudev')
-rw-r--r--src/libudev/libudev-enumerate.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libudev/libudev-enumerate.c b/src/libudev/libudev-enumerate.c
index 172965511b..6a5f4e025e 100644
--- a/src/libudev/libudev-enumerate.c
+++ b/src/libudev/libudev-enumerate.c
@@ -81,6 +81,8 @@ _public_ struct udev_enumerate *udev_enumerate_new(struct udev *udev)
{
struct udev_enumerate *udev_enumerate;
+ if (udev == NULL)
+ return NULL;
udev_enumerate = calloc(1, sizeof(struct udev_enumerate));
if (udev_enumerate == NULL)
return NULL;