From: Sage Weil Date: Mon, 9 Apr 2012 18:25:41 +0000 (-0700) Subject: encoding: fix iterator use for struct_len copy_in X-Git-Tag: v0.45~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bd518e998c0ff12d611db19a8cff6da3622597cb;p=ceph.git encoding: fix iterator use for struct_len copy_in The end() iterator position does not record an offset when the list is modified. Signed-off-by: Sage Weil --- diff --git a/src/include/encoding.h b/src/include/encoding.h index e9bf1e926011..7e5bb3a476f4 100644 --- a/src/include/encoding.h +++ b/src/include/encoding.h @@ -656,8 +656,9 @@ inline void decode(std::deque& ls, bufferlist::iterator& p) ::encode(struct_v, bl); \ ::encode(struct_compat, bl); \ __le32 struct_len = 0; \ - buffer::list::iterator struct_len_it = bl.end(); \ ::encode(struct_len, bl); \ + buffer::list::iterator struct_len_it = bl.end(); \ + struct_len_it.advance(-4); \ do { /**