Skip to content

Commit

Permalink
fix(tasks): add content length check to decode force run request
Browse files Browse the repository at this point in the history
  • Loading branch information
AlirieGray committed Jan 8, 2020
1 parent 128b9ee commit 0dd7b31
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
1. [16435](https://github.com/influxdata/influxdb/pull/16435): Time labels are no longer squished to the left
1. [16427](https://github.com/influxdata/influxdb/pull/16427): Fixed underlying issue with disappearing queries made in Advanced Mode
1. [16439](https://github.com/influxdata/influxdb/pull/16439): Prevent negative zero and allow zero to have decimal places
1. [16458](https://github.com/influxdata/influxdb/pull/16458): Fix EOF error when manually running tasks from the Task Page.

### UI Improvements
1. [16444](https://github.com/influxdata/influxdb/pull/16444): Add honeybadger reporting to create checks
Expand Down
7 changes: 5 additions & 2 deletions http/task_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -1085,8 +1085,11 @@ func decodeForceRunRequest(ctx context.Context, r *http.Request) (forceRunReques
var req struct {
ScheduledFor string `json:"scheduledFor"`
}
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
return forceRunRequest{}, err

if r.ContentLength != 0 && r.ContentLength < 1000 { // prevent attempts to use up memory since r.Body should include at most one item (RunManually)
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
return forceRunRequest{}, err
}
}

var t time.Time
Expand Down

0 comments on commit 0dd7b31

Please sign in to comment.