From: Radoslaw Zarzynski Date: Fri, 4 Nov 2016 12:45:44 +0000 (+0100) Subject: rgw: fix error handling in RGWPostObj_ObjStore::read_with_boundary. X-Git-Tag: v12.0.3~99^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=791edf10677b534e9065b85d6a9fd1fc10d4e66f;p=ceph.git rgw: fix error handling in RGWPostObj_ObjStore::read_with_boundary. Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index 666cac2f963f..572b58aa9b9e 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -1362,6 +1362,9 @@ int RGWPostObj_ObjStore::read_with_boundary(ceph::bufferlist& bl, bufferptr bp(need_to_read); const auto read_len = recv_body(s, bp.c_str(), need_to_read); + if (read_len < 0) { + return read_len; + } in_data.append(bp, 0, read_len); } @@ -1390,7 +1393,10 @@ int RGWPostObj_ObjStore::read_with_boundary(ceph::bufferlist& bl, if (left < skip + 2) { int need = skip + 2 - left; bufferptr boundary_bp(need); - recv_body(s, boundary_bp.c_str(), need); + const int r = recv_body(s, boundary_bp.c_str(), need); + if (r < 0) { + return r; + } in_data.append(boundary_bp); } max += skip; // skip boundary for next time