From af4fc98fc2189f5c267d470bb409cda4a60f2343 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Wed, 21 Jun 2023 13:03:43 -0300 Subject: [PATCH] stop decoding strings unsafely. --- event_easyjson.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/event_easyjson.go b/event_easyjson.go index fc972b6..a17ebc0 100644 --- a/event_easyjson.go +++ b/event_easyjson.go @@ -39,9 +39,9 @@ func easyjsonF642ad3eDecodeGithubComNbdWtfGoNostr(in *jlexer.Lexer, out *Event) } switch key { case "id": - out.ID = in.UnsafeString() + out.ID = in.String() case "pubkey": - out.PubKey = in.UnsafeString() + out.PubKey = in.String() case "created_at": out.CreatedAt = Timestamp(in.Int64()) case "kind": @@ -91,9 +91,9 @@ func easyjsonF642ad3eDecodeGithubComNbdWtfGoNostr(in *jlexer.Lexer, out *Event) in.Delim(']') } case "content": - out.Content = in.UnsafeString() + out.Content = in.String() case "sig": - out.Sig = in.UnsafeString() + out.Sig = in.String() default: out.extra[key] = in.Interface() }