mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
fix wrong memcmp() usage in CKey::operator==
- add a check for CKey::size() of a and b (size can be 0 or 32) - change the fixed value in memcmp() to use a.size() instead - fixes #3090
This commit is contained in:
parent
377cd74930
commit
a39967401e
@ -205,7 +205,8 @@ public:
|
||||
}
|
||||
|
||||
friend bool operator==(const CKey &a, const CKey &b) {
|
||||
return a.fCompressed == b.fCompressed && memcmp(&a.vch[0], &b.vch[0], 32);
|
||||
return a.fCompressed == b.fCompressed && a.size() == b.size() &&
|
||||
memcmp(&a.vch[0], &b.vch[0], a.size()) == 0;
|
||||
}
|
||||
|
||||
// Initialize using begin and end iterators to byte data.
|
||||
|
Loading…
Reference in New Issue
Block a user