8255199: Catching a few NumberFormatExceptions in xmldsig
Reviewed-by: rhalade
This commit is contained in:
parent
a5367cbb7a
commit
62eab50582
@ -281,9 +281,13 @@ public class RFC2253Parser {
|
||||
&& (c2 >= 48 && c2 <= 57
|
||||
|| c2 >= 65 && c2 <= 70
|
||||
|| c2 >= 97 && c2 <= 102)) {
|
||||
char ch = (char) Byte.parseByte("" + c1 + c2, 16);
|
||||
try {
|
||||
char ch = (char) Byte.parseByte("" + c1 + c2, 16);
|
||||
|
||||
sb.append(ch);
|
||||
sb.append(ch);
|
||||
} catch (NumberFormatException ex) {
|
||||
throw new IOException(ex);
|
||||
}
|
||||
} else {
|
||||
sb.append(c1);
|
||||
sb.append(c2);
|
||||
|
@ -125,7 +125,11 @@ public abstract class DOMHMACSignatureMethod extends AbstractDOMSignatureMethod
|
||||
SignatureMethodParameterSpec unmarshalParams(Element paramsElem)
|
||||
throws MarshalException
|
||||
{
|
||||
outputLength = Integer.parseInt(paramsElem.getFirstChild().getNodeValue());
|
||||
try {
|
||||
outputLength = Integer.parseInt(paramsElem.getFirstChild().getNodeValue());
|
||||
} catch (NumberFormatException ex) {
|
||||
throw new MarshalException("Invalid output length supplied: " + paramsElem.getFirstChild().getNodeValue());
|
||||
}
|
||||
outputLengthSet = true;
|
||||
LOG.debug("unmarshalled outputLength: {}", outputLength);
|
||||
return new HMACParameterSpec(outputLength);
|
||||
|
Loading…
x
Reference in New Issue
Block a user