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 <sage.weil@dreamhost.com>
This commit is contained in:
Sage Weil 2012-04-09 11:25:41 -07:00
parent 36d42deab8
commit bd518e998c

View File

@ -656,8 +656,9 @@ inline void decode(std::deque<T>& 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 {
/**