diff --git a/routers/api/v1/repo/project.go b/routers/api/v1/repo/project.go index 048992d6e8..464270c968 100644 --- a/routers/api/v1/repo/project.go +++ b/routers/api/v1/repo/project.go @@ -574,6 +574,10 @@ func EditProjectColumn(ctx *context.APIContext) { column.Color = *form.Color } if form.Sorting != nil { + if *form.Sorting < -128 || *form.Sorting > 127 { + ctx.APIError(http.StatusBadRequest, "sorting value out of range, must be between -128 and 127") + return + } column.Sorting = int8(*form.Sorting) }