From 0178478199706ac1921bda0815697590391322b9 Mon Sep 17 00:00:00 2001 From: William Casarin Date: Sun, 6 Aug 2023 06:45:31 -0700 Subject: [PATCH] decoding: fix decoding of large events like nostr reports I was trying to do an initial malloc that was somewhat efficient. Looks like our ndb_builder needs a bit more space when allocating the ndb_note. Changelog-Fixed: Fixed nostr reporting decoding --- damus/Nostr/NostrResponse.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/damus/Nostr/NostrResponse.swift b/damus/Nostr/NostrResponse.swift index a713953f..5b1ec08b 100644 --- a/damus/Nostr/NostrResponse.swift +++ b/damus/Nostr/NostrResponse.swift @@ -39,7 +39,7 @@ enum NostrResponse { static func owned_from_json(json: String) -> NostrResponse? { return json.withCString{ cstr in - let bufsize: Int = max(Int(Double(json.utf8.count) * 2.0), Int(getpagesize())) + let bufsize: Int = max(Int(Double(json.utf8.count) * 4.0), Int(getpagesize())) let data = malloc(bufsize) if data == nil {