From: Yehuda Sadeh Date: Thu, 27 Sep 2012 21:58:12 +0000 (-0700) Subject: rgw: catch possible exception X-Git-Tag: v0.54~83^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=79b15a26582b7f9ee4c2da97b718396b854a2dce;p=ceph.git rgw: catch possible exception Fix coverity issue 717168. Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 0114204f6ff..9c136a8aad5 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -471,7 +471,11 @@ int RGWRados::log_show_next(RGWAccessHandle handle, rgw_log_entry *entry) return r; state->pos += r; bufferlist old; - old.substr_of(state->bl, off, state->bl.length() - off); + try { + old.substr_of(state->bl, off, state->bl.length() - off); + } catch (buffer::error& err) { + return -EINVAL; + } state->bl.clear(); state->bl.claim(old); state->bl.claim_append(more);