adbd: Fix check against valid payload size

block->payload and its size are not valid when it is used to check
against bytes_left due to std::move() performed on its just prior
to the check. Hence check will always fail to detect the case where
received data is more than expected. To detect this condition and
allow error handling with std::move(), remove extra payload variable
and directly use block->payload.

Bug: http://b/168917244
Change-Id: I992bbba9d9a9861a195834f69d62e69b90658210
(cherry picked from commit 1cc42d32ce2f68b3aa3d7b6cc70ac2cd9c810b8b)
1 file changed