Fix p_secstodate overflow handling (bug 22463)

Joseph Myers joseph@codesourcery.com
Tue Nov 21 17:26:00 GMT 2017


Here's the updated ChangeLog entry for this revised patch version.

2017-11-21  Joseph Myers  <joseph@codesourcery.com>

	[BZ #22463]
	* resolv/res_debug.c: Include <libc-diag.h>.
	(p_secstodate): Assert time_t at least as wide as u_long.  On
	overflow, use integer seconds since the epoch as output, or use
	"<overflow>" as output and set errno to EOVERFLOW if integer
	seconds since the epoch would be 14 or more characters.
	(p_secstodate) [__GNUC_PREREQ (7, 0)]: Disable -Wformat-overflow=
	for sprintf call.
	* resolv/tst-p_secstodate.c: New file.
	* resolv/Makefile (tests): Add tst-p_secstodate.
	($(objpfx)tst-p_secstodate): Depend on $(objpfx)libresolv.so.

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Libc-alpha mailing list