From dbbdbd6fb75bb1c47d4bef2a0b41eab7bb8e5f5f Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Wed, 28 Nov 2007 15:42:07 +1300 Subject: [PATCH] Die if we fail to parse the XML returned by the MythTV backend. --- ChangeLog | 3 +++ bin/mythtv-status | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) 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; } -- 2.30.2