mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-23 14:40:40 +01:00
Catch NullPointerException from bouncy castle signature verification. This can be triggered by a specially crafted signature. Thanks to Sergio Damian Lerner for finding this.
This commit is contained in:
parent
4b4eb7b623
commit
32cc7b4880
1 changed files with 3 additions and 0 deletions
|
@ -326,6 +326,9 @@ public class ECKey implements Serializable {
|
|||
return signer.verifySignature(data, r.getPositiveValue(), s.getPositiveValue());
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (NullPointerException e) {
|
||||
// Bug in BouncyCastle can cause this for invalid signatures.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue