linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [udev] fix for apply_format()
@ 2003-12-26  1:37 Kay Sievers
  2003-12-30  1:04 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Kay Sievers @ 2003-12-26  1:37 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 97 bytes --]


fix possible NULL pointer in '%c' callout substitution
and cleanup '%D' debug text

thanks,
Kay

[-- Attachment #2: 07-apply_format-bug.diff --]
[-- Type: text/plain, Size: 903 bytes --]

diff -Nru a/namedev.c b/namedev.c
--- a/namedev.c	Fri Dec 26 02:07:55 2003
+++ b/namedev.c	Fri Dec 26 02:07:55 2003
@@ -200,11 +200,12 @@
 			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 @@
 							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);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-12-30  1:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-26  1:37 [udev] fix for apply_format() Kay Sievers
2003-12-30  1:04 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).