From mickey@enforcer.cc  Sat Feb 11 19:57:06 2006
Return-Path: <mickey@enforcer.cc>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 8D1D216A420
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 11 Feb 2006 19:57:06 +0000 (GMT)
	(envelope-from mickey@enforcer.cc)
Received: from mail-in-01.arcor-online.net (mail-in-06.arcor-online.net [151.189.21.46])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 1675343D45
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 11 Feb 2006 19:57:05 +0000 (GMT)
	(envelope-from mickey@enforcer.cc)
Received: from mail-in-05-z2.arcor-online.net (mail-in-05-z2.arcor-online.net [151.189.8.17])
	by mail-in-01.arcor-online.net (Postfix) with ESMTP id DCBAB12E335
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 11 Feb 2006 20:57:03 +0100 (CET)
Received: from mail-in-02.arcor-online.net (mail-in-02.arcor-online.net [151.189.21.42])
	by mail-in-05-z2.arcor-online.net (Postfix) with ESMTP id C24A6B15A6
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 11 Feb 2006 20:57:03 +0100 (CET)
Received: from mail.enforcer.cc (dslb-084-059-007-197.pools.arcor-ip.net [84.59.7.197])
	by mail-in-02.arcor-online.net (Postfix) with ESMTP id 6E31B1B669F
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 11 Feb 2006 20:56:55 +0100 (CET)
Received: from mickey by mail.enforcer.cc with local (Exim 4.60 (FreeBSD))
	(envelope-from <mickey@enforcer.cc>)
	id 1F80rW-000FPO-Al
	for FreeBSD-gnats-submit@freebsd.org; Sat, 11 Feb 2006 20:56:54 +0100
Message-Id: <E1F80rW-000FPO-Al@mail.enforcer.cc>
Date: Sat, 11 Feb 2006 20:56:54 +0100
From: Andreas S. Wetzel <mickey242@gmx.net>
Sender: "Andreas S. Wetzel" <mickey@enforcer.cc>
Reply-To: Andreas S. Wetzel <mickey242@gmx.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: strptime(3) succeeds on formats it should fail on
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         93197
>Category:       kern
>Synopsis:       [libc] strptime(3) succeeds on formats it should fail on
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 11 20:00:20 GMT 2006
>Closed-Date:    
>Last-Modified:  Sat Feb 11 20:49:23 GMT 2006
>Originator:     Andreas S. Wetzel
>Release:        FreeBSD 6.0-RELEASE i386
>Organization:
>Environment:
System: FreeBSD transrapid.enforcer.cc 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Thu Jan 5 18:34:54 CET 2006 root@transrapid.enforcer.cc:/usr/src/sys/i386/compile/TRANSRAPID i386


	
>Description:
	The strptime(3) function succeeds with input that it should fail on according to the given format string.
	Excerpt from the strptime(3) manpage:
	   It returns NULL if one of the conversions failed.
>How-To-Repeat:
	Compile and run this test program. strptime() should obviously fail on input 'March' cause format '%d'
	is not satisfied.
	
#include <stdio.h>
#include <time.h>

int main(int argc, char *argv[])
{
        struct tm tm;
        char *date="March";
        char *test=strptime(date, "%B %d", &tm);
                        
        if(test)
                printf("Broken\n");
        else
                printf("OK\n");

        return 0;
}
                                                
>Fix:

	


>Release-Note:
>Audit-Trail:
>Unformatted:
