From e34ddd1404b9e7e4c3fce222bac91496051eea2b Mon Sep 17 00:00:00 2001 From: PantsuDev Date: Sun, 4 Jun 2017 15:56:36 +1000 Subject: [PATCH] Reduce size of descriptions --- router/upload.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/router/upload.go b/router/upload.go index 5d23d87a..95d67f54 100644 --- a/router/upload.go +++ b/router/upload.go @@ -107,6 +107,9 @@ func (f *uploadForm) ExtractInfo(r *http.Request) error { f.Magnet = strings.TrimSpace(f.Magnet) cache.Impl.ClearAll() defer r.Body.Close() + if len(f.Description) > 500 { + return errInvalidTorrentDescription + } catsSplit := strings.Split(f.Category, "_") // need this to prevent out of index panics