]> git.baikalelectronics.ru Git - uboot.git/commit
abuf: Correct a corner case with abuf_realloc()
authorSimon Glass <sjg@chromium.org>
Mon, 28 Feb 2022 19:08:22 +0000 (12:08 -0700)
committerTom Rini <trini@konsulko.com>
Wed, 6 Apr 2022 18:01:42 +0000 (14:01 -0400)
commitb5e5012fcc5414e7d01bcb7e26acacf469af3e1a
treeaeec82c199fce85b9d4bd59c40030b8039b40ce9
parente24033e9ab1ffa67b6688e54f79a9a327df20142
abuf: Correct a corner case with abuf_realloc()

If the buffer is empty and not allocated, then abuf_realloc() tries to
copy invalid data. This happens because an incorrect change to use
memdup() was added after the original code was written.

Signed-off-by: Simon Glass <sjg@chromium.org>
lib/abuf.c
test/lib/abuf.c