fix: add sorting range validation, reject out-of-range int8 values with 400

This commit is contained in:
beardev-in
2026-05-03 16:04:23 +05:30
parent 060d44e379
commit ac8466f330

View File

@@ -574,6 +574,10 @@ func EditProjectColumn(ctx *context.APIContext) {
column.Color = *form.Color column.Color = *form.Color
} }
if form.Sorting != nil { 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) column.Sorting = int8(*form.Sorting)
} }