si_names access one past the end.

Fix for Coverity perl5 CID 45359.

(cherry picked from commit 00b25eff1415ab27d5829f30fea1fecd57a7934e)
Leaked string in failure path.

Fix for Coverity perl5 CID 29058: Resource leak
(RESOURCE_LEAK) leaked_storage: Variable codeset going out of scope leaks the
storage it points to.

The savepv-ed codeset was not freed in failure path.
(The save_input_locale is freed just few lines later.)

(cherry picked from commit 0ac78434bf60027f078daa1108d6c7bcec1ad6e4)
Use the C_ARRAY_LENGTH.

Use the C_ARRAY_LENGTH instead of sizeof(c_array)/sizeof(c_array[0])
or sizeof(c_array)/sizeof(type_of_element_in_c_array), and C_ARRAY_END
for c_array + C_ARRAY_LENGTH(c_array).

While doing this found potential off-by-one error in sv.c:Perl_sv_magic:
how > C_ARRAY_LENGTH(PL_magic_data)
should probably have been
how >= C_ARRAY_LENGTH(PL_magic_data)
No tests fail, but this seems to be more of an internal sanity check.

(cherry picked from commit c3caa5c3bdbd0ad0bc7ce5e7cd1a8eb5b7ca6a69)
Do not invert a NULL cp_list.

Fix for Coverity perl5 CID 28966.

(cherry picked from commit e76fdebf5815ffaf53ebcfd2c7b78b0e9eacbfd2)
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

(cherry picked from commit b35b96b6f8e35207d18b15dfcdbd0d08a7c6437c)
slen may be uninitialized.

Fix for Coverity perl5 CID 29081: Uninitialized scalar
variable (UNINIT) uninit_use_in_call: Using uninitialized value slen when
calling Perl_croak.

If all fails, slen hasn't been set, and croak will be called with that.

(cherry picked from commit 9b56a01971980348bbaf5753e47fcb59dee1ef49)
fd closes for failure paths.

Fix for Coverity perl5 CIDs 29053, 29055, 29057: Resource leak (RESOURCE_LEAK)
leaked_handle: Handle variable fd going out of scope leaks the handle.

(cherry picked from commit 0a20f69bae04ff02616da2f0128de4e842151093)
add va_end() calls where missing for a va_start() or va_end().

Fix for Coverity perl5 CIDs 29225, 29226, 29227, 29228, 29229: Missing
varargs init or cleanup (VARARGS) missing va_end: va_end was not
called for foo.

Use of va_args must be finished off with va_end (in other words,
use of va_start or va_copy must be bracketed off with va_end).
In most platforms va_end is a no-op, but in some platforms it is
required for proper cleanup (or face stack smash, or memory leak).

Tony: move va_start() out of the declaration block
(cherry picked from commit 3ed3a8afebd64616aef147205403b96b30a4b4ee)
put va_end() in the right place

(cherry picked from commit d4825b278e28006bdc9c3f36ab174eade62d6c4c)
Under GLOBAL_STRUCT mgvtbl-s are const, which angers g++.

See also 31114fe99.

(cherry picked from commit 55cdf547048d9ab6990ce2049934612b3be307a4)
bump $PerlIO::via::VERSION to 0.15

(cherry picked from commit fe2ce09d592612ace5bf8acccba9db512adb54a5)
Get t/porting/cmp_version.t passing again following 3429841

(Can't bump $VERSION to 0.61 or 0.62 since they're already out in 5.21.1
and 5.21.2 with different/more changes than 3429841 in them.)