Browse Source

Merge pull request #3176 from Diapolo/key

fix wrong memcmp() usage in CKey::operator==
0.10
Gavin Andresen 11 years ago
parent
commit
42a12f22d6
  1. 3
      src/key.h

3
src/key.h

@ -205,7 +205,8 @@ public: @@ -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…
Cancel
Save