From 60a31af82d9c27f3bd30a2530023da6ff7eb71b6 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Thu, 11 May 2017 17:28:14 +0200 Subject: [PATCH] rgw: fix error handling in Browser Uploads. The recent Coverity Scan for Ceph (published May 11, 2017 on ceph-devel) shows that the read_form_part_header method of RGWPostObj_ObjStore assigns to a variable but doesn't use it later. The anomaly is caused by lack of proper error handling. This commit rectifies it. Signed-off-by: Radoslaw Zarzynski --- src/rgw/rgw_rest.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index 040f972467c8..cb0e8c1fac07 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -1492,6 +1492,9 @@ int RGWPostObj_ObjStore::read_form_part_header(struct post_form_part* const part } r = read_line(bl, chunk_size, reached_boundary, done); + if (r < 0) { + return r; + } } return 0; -- 2.47.3