Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Oct 2018 16:25:29 +0000 (UTC)
From:      Yuri Pankov <yuripv@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r339346 - head/lib/libc/stdtime
Message-ID:  <201810131625.w9DGPTq7067958@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yuripv
Date: Sat Oct 13 16:25:28 2018
New Revision: 339346
URL: https://svnweb.freebsd.org/changeset/base/339346

Log:
  strptime: disallow zero hour for %I (defined by POSIX as [01,12]) and %l
  (extension, defined in strftime(3) as 1-12).
  
  Approved by:	re (gjb), kib (mentor)
  Differential Revision:	https://reviews.freebsd.org/D17543

Modified:
  head/lib/libc/stdtime/strptime.c

Modified: head/lib/libc/stdtime/strptime.c
==============================================================================
--- head/lib/libc/stdtime/strptime.c	Sat Oct 13 03:12:57 2018	(r339345)
+++ head/lib/libc/stdtime/strptime.c	Sat Oct 13 16:25:28 2018	(r339346)
@@ -291,7 +291,7 @@ label:
 			if (c == 'H' || c == 'k') {
 				if (i > 23)
 					return (NULL);
-			} else if (i > 12)
+			} else if (i == 0 || i > 12)
 				return (NULL);
 
 			tm->tm_hour = i;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201810131625.w9DGPTq7067958>