svn commit: trunk/busybox/miscutils

vodz at busybox.net vodz at busybox.net
Tue Jan 31 09:35:46 UTC 2006


Author: vodz
Date: 2006-01-31 01:35:45 -0800 (Tue, 31 Jan 2006)
New Revision: 13749

Log:
protect potential overflow for x86_64

Modified:
   trunk/busybox/miscutils/last.c


Changeset:
Modified: trunk/busybox/miscutils/last.c
===================================================================
--- trunk/busybox/miscutils/last.c	2006-01-31 09:28:52 UTC (rev 13748)
+++ trunk/busybox/miscutils/last.c	2006-01-31 09:35:45 UTC (rev 13749)
@@ -47,6 +47,7 @@
 {
 	struct utmp ut;
 	int n, file = STDIN_FILENO;
+	time_t t_tmp;
 
 	if (argc > 1) {
 		bb_show_usage();
@@ -98,9 +99,9 @@
 					break;
 			}
 		}
-
+		t_tmp = (time_t)ut.ut_tv.tv_sec;
 		printf("%-10s %-14s %-18s %-12.12s\n", ut.ut_user, ut.ut_line, ut.ut_host,
-				ctime((time_t *)&(ut.ut_tv.tv_sec)) + 4);
+				ctime(&t_tmp) + 4);
 	}
 
 	bb_fflush_stdout_and_exit(EXIT_SUCCESS);




More information about the busybox-cvs mailing list