Subject: | Use of uninitialized value in OLE.xs Variant::Type() function |
Date: | Sun, 6 May 2018 12:32:21 +0800 |
To: | bug-Win32-OLE [...] rt.cpan.org |
From: | SJ Luo <sjaluo [...] gmail.com> |
Hi,
I downloaded the module from CPAN and compiled by myself. The 'make
test' produces some warning messages when performing test on
t/2_variant.t:
% make test
"/usr/bin/perl.exe" -MExtUtils::Command::MM -e 'cp_nonempty' -- OLE.bs
blib/arch/auto/Win32/OLE/OLE.bs 644
PERL_DL_NONLAZY=1 "/usr/bin/perl.exe" "-MExtUtils::Command::MM"
"-MTest::Harness" "-e" "undef *Test::Harness::Switches;
test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/1_nls.t ....... ok
t/2_variant.t ... 1/38 Win32::OLE(0.1712) error 0xffffccb0 at
t/2_variant.t line 39.
eval {...} called at t/2_variant.t line 39
Win32::OLE(0.1712) error 0xffffccb0 at t/2_variant.t line 40.
eval {...} called at t/2_variant.t line 40
Win32::OLE(0.1712) error 0xffffccb0 at t/2_variant.t line 73.
eval {...} called at t/2_variant.t line 73
Win32::OLE(0.1712) error 0xffffccb0 at t/2_variant.t line 94.
eval {...} called at t/2_variant.t line 94
:
I found the warning messages come from an issue in OLE.xs function
Type(). There is a flow control according to variable ix and then a
CheckOleError() is called with variable hr. IT seems hr value is
uninitialized on this call if the flow went through ix=0,3,4,5.
A patch to fix it is as attached.
Message body is not shown because sender requested not to inline it.