[ 
https://issues.apache.org/jira/browse/STDCXX-749?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12580871#action_12580871
 ] 

Martin Sebor commented on STDCXX-749:
-------------------------------------

Here's a test case that demonstrates that the warnings point out a moderately 
serious problem in the {{localedef}} utility: it crashes on invalid {{LC_TIME}} 
input, in particular when the {{era}} specification is incomplete:

{noformat}
$ cat >charmap<<EOF && cat >locale.src<<EOF && ../bin/localedef -c -w --notes 
-f charmap -i locale.src dummy && LC_TIME=dummy ../bin/locale -ck LC_TIME
CHARMAP
END CHARMAP
EOF
comment_char #
LC_TIME
# direction:offset:start_date:end_date:era_name:era_format
era "+1"
END LC_TIME
EOF
Note 801: processing character set description file charmap
Note 802: reading charmap
Note 801: processing CHARMAP section
Note 801: done processing CHARMAP section (1 tokens, 0 ellipses, 0 characters)
Note 801: processing locale definition file locale.src
Note 802: reading locale.src
Note 801: processing LC_TIME section
Segmentation fault
{noformat}

> [HP aCC 6.16] Potential null pointer dereference in time.cpp
> ------------------------------------------------------------
>
>                 Key: STDCXX-749
>                 URL: https://issues.apache.org/jira/browse/STDCXX-749
>             Project: C++ Standard Library
>          Issue Type: Sub-task
>          Components: Utilities
>    Affects Versions: 4.2.0
>         Environment: $ uname -sr && aCC -V
> HP-UX B.11.31
> aCC: HP C/aC++ B3910B A.06.16 [Nov 26 2007]
>            Reporter: Scott (Yu) Zhong
>            Assignee: Martin Sebor
>             Fix For: 4.2.1
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> "/amd/devco/scottz/stdcxx/4.2.x/util/time.cpp", line 70, procedure parse_era: 
> warning #20200-D: Potential null pointer dereference through tokp is detected 
> (null definition:/amd/devco/scottz/stdcxx/4.2.x/util/time.cpp, line 69)
> "/amd/devco/scottz/stdcxx/4.2.x/util/time.cpp", line 77, procedure parse_era: 
> warning #20200-D: Potential null pointer dereference through tokp is detected 
> (null definition:/amd/devco/scottz/stdcxx/4.2.x/util/time.cpp, line 75)
> "/amd/devco/scottz/stdcxx/4.2.x/util/time.cpp", line 97, procedure parse_era: 
> warning #20200-D: Potential null pointer dereference through tokp is detected 
> (null definition:/amd/devco/scottz/stdcxx/4.2.x/util/time.cpp, line 85)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to