This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Uninitialized tmbuf.
authorJarkko Hietaniemi <jhi@iki.fi>
Wed, 7 May 2014 13:26:52 +0000 (09:26 -0400)
committerTony Cook <tony@develop-help.com>
Thu, 29 May 2014 04:50:11 +0000 (14:50 +1000)
commitb35b96b6f8e35207d18b15dfcdbd0d08a7c6437c
tree005d69e19363295be1dc3e30f5d0ac39c586bf68
parent0a20f69bae04ff02616da2f0128de4e842151093
Uninitialized tmbuf.

Fix for Coverity perl5 CID 29088: Uninitialized scalar variable (UNINIT)
uninit_use: Using uninitialized value tmbuf.tm_year.

There is a code path that can lead to accessing uninitialized tmbuf:
when the too-small or too-large time inputs to gmtime/localtime
happen.

- make it so that the tm_year is used only on successful code path:
  pp_sys.c
- add the gmtime failed / localtime failed errors to perldiag:
  pod/perldiag.pod
- test those errors: t/op/time.t
pod/perldiag.pod
pp_sys.c
t/op/time.t