svn commit: trunk/busybox/loginutils
vodz at busybox.net
vodz at busybox.net
Tue Jan 31 11:16:42 UTC 2006
Author: vodz
Date: 2006-01-31 03:16:40 -0800 (Tue, 31 Jan 2006)
New Revision: 13752
Log:
destroy potential overflow for x86_64. Added ATTRIBUTE_UNUSED
Modified:
trunk/busybox/loginutils/login.c
Changeset:
Modified: trunk/busybox/loginutils/login.c
===================================================================
--- trunk/busybox/loginutils/login.c 2006-01-31 09:53:53 UTC (rev 13751)
+++ trunk/busybox/loginutils/login.c 2006-01-31 11:16:40 UTC (rev 13752)
@@ -52,7 +52,7 @@
static void motd ( void );
-static void alarm_handler ( int sig )
+static void alarm_handler ( int sig ATTRIBUTE_UNUSED)
{
fprintf (stderr, "\nLogin timed out after %d seconds.\n", TIMEOUT );
exit ( EXIT_SUCCESS );
@@ -432,6 +432,8 @@
if (ut) {
utent = *ut;
} else {
+ time_t t_tmp;
+
if (picky) {
puts(NO_UTENT);
exit(1);
@@ -450,7 +452,8 @@
/* XXX - assumes /dev/tty?? */
strncpy(utent.ut_id, utent.ut_line + 3, sizeof utent.ut_id);
strncpy(utent.ut_user, "LOGIN", sizeof utent.ut_user);
- time((time_t*)&utent.ut_time);
+ t_tmp = (time_t)utent.ut_time;
+ time(&t_tmp);
}
}
@@ -461,7 +464,7 @@
* USER_PROCESS. the wtmp file will be updated as well.
*/
-static void setutmp(const char *name, const char *line)
+static void setutmp(const char *name, const char *line ATTRIBUTE_UNUSED)
{
utent.ut_type = USER_PROCESS;
strncpy(utent.ut_user, name, sizeof utent.ut_user);
More information about the busybox-cvs
mailing list