svn commit: trunk/uClibc/libc/misc/time

vapier at uclibc.org vapier at uclibc.org
Wed Mar 1 01:03:44 UTC 2006


Author: vapier
Date: 2006-02-28 17:03:41 -0800 (Tue, 28 Feb 2006)
New Revision: 14374

Log:
return NULL if year is too big

Modified:
   trunk/uClibc/libc/misc/time/time.c


Changeset:
Modified: trunk/uClibc/libc/misc/time/time.c
===================================================================
--- trunk/uClibc/libc/misc/time/time.c	2006-03-01 00:51:35 UTC (rev 14373)
+++ trunk/uClibc/libc/misc/time/time.c	2006-03-01 01:03:41 UTC (rev 14374)
@@ -365,10 +365,22 @@
 			tmp /= 10;
 		} while (*--buffer == '?');
 	}
+/*	Not sure if we should even bother ...
+	} else {
+		__set_errno(EOVERFLOW);
+		return NULL;
+	}
+*/
 #else  /* SAFE_ASCTIME_R */
 	buffer += 23;
 	tmp = ptm->tm_year + 1900;
 	assert( ((unsigned int) tmp) < 10000 );
+/*	Not sure if we should even bother ...
+	if ( ((unsigned int) tmp) >= 10000 ) {
+		__set_errno(EOVERFLOW);
+		return NULL;
+	}
+*/
 	do {
 		*buffer = '0' + (tmp % 10);
 		tmp /= 10;



More information about the uClibc-cvs mailing list