Fix stack corruption in bech32 parsing
This commit fixes a stack corruption issue caused by an off-by-one error in one of the functions responsible for parsing bech32 entities. Changelog-None Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
This commit is contained in:
@@ -307,7 +307,7 @@ int parse_nostr_bech32(unsigned char *buf, int buflen,
|
||||
unsigned char *start;
|
||||
size_t parsed_len, u5_out_len, u8_out_len;
|
||||
enum nostr_bech32_type type;
|
||||
#define MAX_PREFIX 8
|
||||
#define MAX_PREFIX 9 // 8 bytes for the text, 1 byte for the null terminator
|
||||
struct cursor cur, bech32, u8;
|
||||
|
||||
make_cursor(buf, buf + buflen, &cur);
|
||||
|
||||
Reference in New Issue
Block a user