Kills some live mutants on interpreter.cpp found by https://bitcoincore.space. They are:
interpreter.cpp#5168: IsCompressedOrUncompressedPubKey: pubkey with neither compressed nor uncompressed prefix returns true
- } else if (vchPubKey[0] == 0x02 || vchPubKey[0] == 0x03) {
+ } else if (1==1) {
interpreter.cpp#5191: IsValidSignatureEncoding: 73-byte upper bound returns true
if (sig.size() < 9) return false;
- if (sig.size() > 73) return false;
interpreter.cpp#5200: IsValidSignatureEncoding: total-length byte check returns true
// Make sure the length covers the entire signature.
- if (sig[1] != sig.size() - 3) return false;
interpreter.cpp#5232: IsValidSignatureEncoding: null R byte check lenR > 1 -> lenR >=1
// Null bytes at the start of R are not allowed, unless R would
// otherwise be interpreted as a negative number.
- if (lenR > 1 && (sig[4] == 0x00) && !(sig[5] & 0x80)) return false;
+ if (lenR >= 1 && (sig[4] == 0x00) && !(sig[5] & 0x80)) return false;
interpreter.cpp#5259: IsValidSignatureEncoding: null S byte check lenS > 1 -> lenS >= 1
// Null bytes at the start of S are not allowed, unless S would otherwise be
// interpreted as a negative number.
- if (lenS > 1 && (sig[lenR + 6] == 0x00) && !(sig[lenR + 7] & 0x80)) return false;
+ if (lenS >= 1 && (sig[lenR + 6] == 0x00) && !(sig[lenR + 7] & 0x80)) return false;
interpreter.cpp#5186: IsValidSignatureEncoding: 9-byte lower bound returns true
// Minimum and maximum size constraints.
- if (sig.size() < 9) return false;
The first affects policy only, the next four affect consensus, and the last covers the lower bound and lets ASan catch UB: a 3-byte signature reaches the sig[3] read that the sig.size() < 9 guard protects.
Recommend reviewing per commit.