From: Andrew Ruthven Date: Wed, 28 Nov 2007 02:42:07 +0000 (+1300) Subject: Die if we fail to parse the XML returned by the MythTV backend. X-Git-Tag: 0.6.0~39 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dbbdbd6fb75bb1c47d4bef2a0b41eab7bb8e5f5f;p=mythtv-status.git Die if we fail to parse the XML returned by the MythTV backend. --- diff --git a/ChangeLog b/ChangeLog index 5fe7c3a..7b8d52e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2007-11-28 Andrew Ruthven + Be more wary about processing what the backend has sent us. + 2007-11-23 Andrew Ruthven Don't set the background when changing the colour. Make the new debconf prompt lintian clean and say how to specify diff --git a/bin/mythtv-status b/bin/mythtv-status index f4673ae..a679eae 100755 --- a/bin/mythtv-status +++ b/bin/mythtv-status @@ -282,7 +282,13 @@ sub load_xml { # Parse the XML my $parser = XML::LibXML->new(); - return eval { $parser->parse_string( $status ) }; + my $xml = eval { $parser->parse_string( $status ) }; + + if ($@) { + die "Failed to parse XML from $url: $@\n"; + } + + return $xml; }