Subject: | Use of uninitialized value $val in scalar assignment at /usr/bin/lib/Image/ExifTool/XMP.pm line 3033. |
Date: | Tue, 14 Oct 2014 00:45:31 +0000 |
To: | bug-Image-ExifTool [...] rt.cpan.org |
From: | gulfie <gulfie [...] kipofu.com> |
I have an rss file that recognises as xmpp yet the parsing seems to get cranky. I have an example and a one line fix.
(environment of example, it also showed up on ubuntu and version 9.46 )
bash-3.2$ egrep 'version =' /usr/bin/exiftool
my $version = '9.73';
bash-3.2$ uname -a
Darwin bbbb-2.local 13.3.0 Darwin Kernel Version 13.3.0: Tue Jun 3 21:27:35 PDT 2014; root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64
( simple reproduction )
bash-3.2$ curl -s http://www.permies.com/forums/rss/topicPosts/27261 | exiftool - > /dev/null
Use of uninitialized value $val in scalar assignment at /usr/bin/lib/Image/ExifTool/XMP.pm line 3033.
Use of uninitialized value $val in pattern match (m//) at /usr/bin/lib/Image/ExifTool/XMP.pm line 3034.
Use of uninitialized value $str in substitution (s///) at /usr/bin/lib/Image/ExifTool/XMP.pm line 2297.
Use of uninitialized value $val in pattern match (m//) at /usr/bin/lib/Image/ExifTool/XMP.pm line 2809.
Use of uninitialized value $val in pattern match (m//) at /usr/bin/lib/Image/ExifTool/XMP.pm line 2793.
Use of uninitialized value $val in numeric gt (>) at /usr/bin/lib/Image/ExifTool/XMP.pm line 3061.
bash-3.2$
A shorter version of a file that exibits this behavior is :
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title><![CDATA[permies: Latest posts for the topic "Permaculture Playing Cards Kickstarter"]]></title>
<link>http://www.permies.com/forums/t/123/permaculture-design/Permaculture-Playing-Cards-Kickstarter</link>
<description><![CDATA[Latest messages posted in the topic "Permaculture Playing Cards Kickstarter"]]></description>
<generator>JForum - http://www.jforum.net</generator>
<item>
<title>Permaculture Playing Cards Kickstarter</title>
<description><![CDATA[Going to bed now after playing some solitaire with mine. Got them yesterday and already have people on facebook asking questions! This is definitely the start of something great. Thanks Paul and Alex!^M<br /> <img width:auto;"><tr><td><a href="https://picasaweb.google.com/lh/photo/BbmnLCo6Lcu2Rgie1qyo6qAxddN6T8xX-XeNaziiKR4?feat=embedwebsite"><img src="https://lh4.googleusercontent.com/-i1OBWouQwpg/UpbRJztqdHI/AAAAAAAABHI/zoj7MOWlNIU/s640/IMAGE_30.jpg" height="480" width="640" /></a></td></tr><tr><td style="font-family:arial,sans-serif; font-size:11px; text-align:right">From <a href="https://picasaweb.google.com/107232035046866765414/Permaculture?authuser=0&feat=embedwebsite">" border="0" />]]></description>
<guid isPermaLink="true">http://www.permies.com/forums/posts/preList/27261/233950</guid>
<link>http://www.permies.com/forums/posts/preList/27261/233950</link>
<pubDate><![CDATA[Wed, Nov 27 2013 22:19:33 MST]]></pubDate>
<author><![CDATA[Lucas Harrison-Zdenek]]></author>
</blockquote>^M<br /> ^M<br /> Why not just change your description to reflect that, to stimulate larger orders.</div>
</blockquote>^M<br /> ^M<br /> Because there could be other sellers that don't honor that.^M<br /> </div>
</blockquote>]]></description>
<guid isPermaLink="true">http://www.permies.com/forums/posts/preList/27261/234583</guid>
<link>http://www.permies.com/forums/posts/preList/27261/234583</link>
<pubDate><![CDATA[Mon, Dec 2 2013 11:00:48 MST]]></pubDate>
<author><![CDATA[paul wheaton]]></author>
</item>
</channel>
</rss>
My understanding is that there is some invalidness around the chunk : ebsite">" border="0" />]] .... Whatever is happening there causes $val to be undefined in ParseXMPElement, and passed over to the error location.
A quick patch out of this would be adding ' return 0 unless defined $val;
' to the top of sub FoundXMP($$$$;$)
Good luck.
-gulfie