From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Date: Fri, 26 Dec 2003 01:37:37 +0000 Subject: [udev] fix for apply_format() MIME-Version: 1 Content-Type: multipart/mixed; boundary="+g7M9IMkV8truYOl" Message-Id: List-Id: To: linux-hotplug@vger.kernel.org --+g7M9IMkV8truYOl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline fix possible NULL pointer in '%c' callout substitution and cleanup '%D' debug text thanks, Kay --+g7M9IMkV8truYOl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="07-apply_format-bug.diff" 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); --+g7M9IMkV8truYOl-- ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel