commit cb8585e4f89983db42d9069a22a20ea51f4732d2
parent 44a2c4ba7bf6ac819a6132a7e8753aeca05f249b
Author: William Casarin <jb55@jb55.com>
Date: Tue, 11 Apr 2023 10:03:48 -0700
Fix naddr crash
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/damus-c/damus.c b/damus-c/damus.c
@@ -167,11 +167,15 @@ static int parse_mention_bech32(struct cursor *cur, struct block *block) {
if (!parse_str(cur, "nostr:"))
return 0;
+ block->block.str.start = (const char *)cur->p;
+
if (!parse_nostr_bech32(cur, &block->block.mention_bech32.bech32)) {
cur->p = start;
return 0;
}
+ block->block.str.end = (const char *)cur->p;
+
block->type = BLOCK_MENTION_BECH32;
return 1;