Fixes bug #58553, and the newly added unit test. The pbuf_take_at loop should probably be made into a pbuf library function, which would avoid this mistake in the future and provide a simpler implementation of pbuf_copy.
Fixes bug #58553, and the newly added unit test. The pbuf_take_at loop should probably be made into a pbuf library function, which would avoid this mistake in the future and provide a simpler implementation of pbuf_copy.