iproto: fix assertion failure on invalid msgpack
Before the commit d9f82b17 "More than one row in fixheader. Zstd compression", xrow_header_decode treated everything until 'end' as the packet body while currently it allows a packet to end before 'end'. The iproto_msg_decode may receive an invalid msgpack but it still assumes that xrow_header_decode sets an error in such case and use assert to test it, bit it is not so. Introduced a new boolean flag to control routine behaviour. When flag is set, xrow_header_decode should raise 'packet body' error unless the packet ends exactly at 'end'. @locker: renamed ensure_package_read to end_is_exact; fixed comments. Closes #3900
Showing
- src/box/iproto.cc 1 addition, 1 deletionsrc/box/iproto.cc
- src/box/vy_run.c 2 additions, 2 deletionssrc/box/vy_run.c
- src/box/xlog.c 1 addition, 1 deletionsrc/box/xlog.c
- src/box/xrow.c 5 additions, 1 deletionsrc/box/xrow.c
- src/box/xrow.h 8 additions, 6 deletionssrc/box/xrow.h
- src/box/xrow_io.cc 4 additions, 2 deletionssrc/box/xrow_io.cc
- test/box/net.box.result 25 additions, 0 deletionstest/box/net.box.result
- test/box/net.box.test.lua 11 additions, 0 deletionstest/box/net.box.test.lua
- test/unit/xrow.cc 2 additions, 2 deletionstest/unit/xrow.cc
Loading
Please register or sign in to comment