This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix p_secstodate overflow handling (bug 22463)


On 11/22/2017 08:49 AM, Joseph Myers wrote:
-	time = __gmtime_r(&clock, &timebuf);
+	if (secs > 0x7fffffff
+	    || (time = __gmtime_r (&clock, &timebuf)) == NULL) {

__gmtime_r cannot return NULL if secs <= 0x7fffffff. As the goal appears to be to leave the current code alone as much as possible, this could be changed to simply check secs first, and then leave the assignment to "time" alone.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]