From c5e1bca7dca78d6ba13afc68cb99fe7ea48f7b1e Mon Sep 17 00:00:00 2001 From: NanXiao Date: Thu, 23 Jun 2016 17:14:11 +0800 Subject: [PATCH] Check r.ParseForm() error in postContainersCreate(). Signed-off-by: NanXiao --- api/handlers.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/handlers.go b/api/handlers.go index 486a4253c6..a3f2d5ca4d 100644 --- a/api/handlers.go +++ b/api/handlers.go @@ -537,7 +537,10 @@ func getContainerJSON(c *context, w http.ResponseWriter, r *http.Request) { // POST /containers/create func postContainersCreate(c *context, w http.ResponseWriter, r *http.Request) { - r.ParseForm() + if err := r.ParseForm(); err != nil { + httpError(w, err.Error(), http.StatusBadRequest) + return + } var ( defaultMemorySwappiness = int64(-1) name = r.Form.Get("name")