svn commit: trunk/busybox/libbb

vapier at busybox.net vapier at busybox.net
Sun Feb 19 23:03:34 UTC 2006


Author: vapier
Date: 2006-02-19 15:03:31 -0800 (Sun, 19 Feb 2006)
New Revision: 14135

Log:
rfelker writes in Bug 742: make sure string is null terminated after calling gethostname


Modified:
   trunk/busybox/libbb/login.c


Changeset:
Modified: trunk/busybox/libbb/login.c
===================================================================
--- trunk/busybox/libbb/login.c	2006-02-19 22:59:12 UTC (rev 14134)
+++ trunk/busybox/libbb/login.c	2006-02-19 23:03:31 UTC (rev 14135)
@@ -96,6 +96,7 @@
 
 					case 'h':
 						gethostname(buf, sizeof(buf) - 1);
+						buf[sizeof(buf) - 1] = '\0';
 						break;
 
 					case 'l':
@@ -105,7 +106,7 @@
 					default:
 						buf[0] = c;
 				}
-		}
+			}
 			fputs(outbuf, stdout);
 		}
 




More information about the busybox-cvs mailing list