vppinfra: fix longstanding corner case bug in serialize_get() 10/37910/2
authorDave Barach <dave@barachs.net>
Thu, 12 Jan 2023 21:07:26 +0000 (16:07 -0500)
committerFlorin Coras <florin.coras@gmail.com>
Thu, 12 Jan 2023 23:03:22 +0000 (23:03 +0000)
commit809eb669c7a353cd06da58ccdf8578053b1233ca
tree4fcf4884aeedc116a40a622a27d616fb9681134b
parentdcca9e75a17aca6fd83586a4de66fed65ec5d11b
vppinfra: fix longstanding corner case bug in serialize_get()

serialize_get() -> serialize_write_not_inline(...) was losing track of
the current buffer index when it managed to empty the overflow vector
but had to turn around and use it again.

Test-case added to test_serialize.c.

This issue dates from 2010.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I024a03f7a50fd6df543ddbc7c45d85def4f1981d
src/vppinfra/serialize.c
src/vppinfra/test_serialize.c