diff options
| author | jnemeth <jnemeth@NetBSD.org> | 2009-10-20 05:33:30 +0000 |
|---|---|---|
| committer | jnemeth <jnemeth@NetBSD.org> | 2009-10-20 05:33:30 +0000 |
| commit | 3f353bcfa217830968e1a1c1584f2bd7e8fed57d (patch) | |
| tree | afabc606a93bcc2ab5e0137cb8e993aff9d60223 /sys/modules/example | |
| parent | 5214d3defbe14fdb034ef6d9d5703b51a4e59b4a (diff) | |
Check to see if we were passed a NULL proplist dictionary.
Diffstat (limited to 'sys/modules/example')
| -rw-r--r-- | sys/modules/example/example.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/modules/example/example.c b/sys/modules/example/example.c index c16d14f9b31..86af7e72a53 100644 --- a/sys/modules/example/example.c +++ b/sys/modules/example/example.c @@ -1,4 +1,4 @@ -/* $NetBSD: example.c,v 1.4 2009/01/14 00:53:44 haad Exp $ */ +/* $NetBSD: example.c,v 1.5 2009/10/20 05:33:30 jnemeth Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: example.c,v 1.4 2009/01/14 00:53:44 haad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: example.c,v 1.5 2009/10/20 05:33:30 jnemeth Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -46,7 +46,11 @@ handle_props(prop_dictionary_t props) { prop_string_t str; - str = prop_dictionary_get(props, "msg"); + if (props != NULL) { + str = prop_dictionary_get(props, "msg"); + } else { + str = NULL; + } if (str == NULL) printf("The 'msg' property was not given.\n"); else if (prop_object_type(str) != PROP_TYPE_STRING) |
