Merge pull request #173 from mattn/fix/kind-overflow

helpers: reject kind numbers above 65535
This commit is contained in:
mattn
2026-07-15 06:50:43 +00:00
committed by GitHub

View File

@@ -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
}