diff options
author | kay.sievers@vrfy.org <kay.sievers@vrfy.org> | 2003-12-30 01:07:59 -0800 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-04-26 21:13:12 -0700 |
commit | 647c8fc43eb8f3d92ed7142f7c235f3db02f4cfa (patch) | |
tree | 641a841df22951deb02a2a771b3015901b1f45c0 | |
parent | 0529e2ed2eb1ccfd28d2cd33ce759f9c7b9bc0ff (diff) |
[PATCH] fix for apply_format()
fix possible NULL pointer in '%c' callout substitution
and cleanup '%D' debug text
-rw-r--r-- | namedev.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -200,11 +200,12 @@ static void apply_format(struct udevice *udev, unsigned char *string) case 'D': if (strlen(udev->kernel_number) == 0) { strcat(pos, "disc"); + dbg("substitute devfs disc"); break; } strcat(pos, "part"); strcat(pos, udev->kernel_number); - dbg("substitute kernel number '%s'", udev->kernel_number); + dbg("substitute devfs part '%s'", udev->kernel_number); break; case 'm': sprintf(pos, "%u", udev->minor); @@ -229,8 +230,10 @@ static void apply_format(struct udevice *udev, unsigned char *string) break; } } - strcat(pos, pos3); - dbg("substitute partial callout output '%s'", pos3); + if (pos3) { + strcat(pos, pos3); + dbg("substitute partial callout output '%s'", pos3); + } } else { strcat(pos, udev->callout_value); dbg("substitute callout output '%s'", udev->callout_value); |