Commit 9c649900 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Wrap a few more XMLin/XMLout calls in eval().

parent 39a33207
......@@ -232,14 +232,23 @@ sub CreateFromSigned($$;$)
my ($cap_node) = $doc->getElementsByTagName("privileges");
return undef
if (!defined($cap_node));
my $rawcapabilities = XMLin($cap_node->toString(),
ForceArray => [ "privilege" ] );
my $rawcapabilities =
eval { XMLin($cap_node->toString(),
ForceArray => [ "privilege" ] ) };
if ($@) {
print STDERR "XMLin error on capabilities: $@\n";
return undef;
}
my $capabilities = $rawcapabilities->{ "privilege" };
# Dig out the extensions
my ($extensions_node) = $doc->getElementsByTagName("extensions");
my $extensions = XMLin($extensions_node->toString())
if (defined($extensions_node));
my $extensions = eval { XMLin($extensions_node->toString()) }
if (defined($extensions_node));
if ($@) {
print STDERR "XMLin error on extensions: $@\n";
return undef;
}
# UUID of the credential.
my ($uuid_node) = $doc->getElementsByTagName("uuid");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment