Commit 5aae1ac0 authored by Leigh B Stoller's avatar Leigh B Stoller

Make sure credentials is really a list.

parent 2eaab789
......@@ -1478,13 +1478,18 @@ sub ListHistory($)
#
sub CheckCredentials($)
{
if (! ref($_[0]) != "ARRAY") {
return
GeniResponse->MalformedArgsResponse("Credentials should be a ".
"array not a singleton");
}
my @credentials = @{ $_[0] };
if (scalar(@credentials) != 1) {
return
GeniResponse->MalformedArgsResponse("Wrong number of credentials");
}
my $credential = GeniCredential->CreateFromSigned($credentials[0]);
my $credential = GeniCredential->CreateFromSigned($credentials[0]);
if (!defined($credential)) {
return GeniResponse->Create(GENIRESPONSE_ERROR, undef,
"Could not create credential object");
......
Markdown is supported
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