mirror of
https://github.com/i2p/i2p.i2p.git
synced 2026-10-23 13:03:04 +00:00
Data: Fix NPE calculating the hash of a RI of unknown sig type
This commit is contained in:
1 parent
d8e15dbbc5
commit
43f7897027
1 file changed
+4
-1
@@ -177,7 +177,10 @@ public class SigningPublicKey extends SimpleDataStructure {
|
||||
* @since 0.9.12
|
||||
*/
|
||||
public void writeTruncatedBytes(OutputStream out) throws DataFormatException, IOException {
|
||||
if (_type.getPubkeyLen() <= KEYSIZE_BYTES)
|
||||
// we don't use _type here so we can write the data even for unknown type
|
||||
//if (_type.getPubkeyLen() <= KEYSIZE_BYTES)
|
||||
if (_data == null) throw new DataFormatException("No data to write out");
|
||||
if (_data.length <= KEYSIZE_BYTES)
|
||||
out.write(_data);
|
||||
else
|
||||
out.write(_data, 0, KEYSIZE_BYTES);
|
||||
|
||||
Reference in new issue
Block a user