summaryrefslogtreecommitdiff
path: root/udev.h
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-02-26 19:40:40 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:32:30 -0700
commit3fe0734266becd2ebcb111b07c3e17b2a9780477 (patch)
tree4d1d6e600380bdc300b0c1db1dfc707e0ba12f05 /udev.h
parente964c2c05d3d6e2bdb21b3461ed7a4e85315cbc1 (diff)
[PATCH] udev - safer string handling - part four
Mainly a cleanup of the earlier patches with a few missing pieces and some cosmetical changes. I've moved the udev_init_config() to very early init, otherwise we don't get any logging for the processing of the input. What would I do without gdb :) Greg, it's the 7th patch in your box to apply. I will stop now and wait for you :)
Diffstat (limited to 'udev.h')
-rw-r--r--udev.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/udev.h b/udev.h
index fa56c36691..3b676acf40 100644
--- a/udev.h
+++ b/udev.h
@@ -90,7 +90,7 @@ static inline char *get_action(void)
char *action;
action = getenv("ACTION");
- if (strlen(action) > ACTION_SIZE)
+ if (action != NULL && strlen(action) > ACTION_SIZE)
action[ACTION_SIZE-1] = '\0';
return action;
@@ -101,7 +101,7 @@ static inline char *get_devpath(void)
char *devpath;
devpath = getenv("DEVPATH");
- if (strlen(devpath) > DEVPATH_SIZE)
+ if (devpath != NULL && strlen(devpath) > DEVPATH_SIZE)
devpath[DEVPATH_SIZE-1] = '\0';
return devpath;
@@ -118,7 +118,7 @@ static inline char *get_seqnum(void)
static inline char *get_subsystem(char *subsystem)
{
- if (strlen(subsystem) > SUBSYSTEM_SIZE)
+ if (subsystem != NULL && strlen(subsystem) > SUBSYSTEM_SIZE)
subsystem[SUBSYSTEM_SIZE-1] = '\0';
return subsystem;