From 6bd793bea5328fdc4af4ec25390871aa49abfab1 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Wed, 15 Jul 2026 08:35:16 +0900 Subject: [PATCH] helpers: reject kind numbers above 65535 instead of silently truncating them to uint16. --- helpers.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/helpers.go b/helpers.go index 8190b48..524513f 100644 --- a/helpers.go +++ b/helpers.go @@ -627,6 +627,9 @@ func getSchema() (schema.Schema, error) { func stringToKind(value string) (nostr.Kind, error) { if n, err := strconv.Atoi(value); err == nil && n >= 0 { + if n > 65535 { + return 0, fmt.Errorf("kind number %d is out of range (0-65535)", n) + } return nostr.Kind(n), nil }