Re: [PATCH 3/2] apply: use COPY_ARRAY and MOVE_ARRAY in update_image()

2017-07-15 Thread René Scharfe
Am 16.07.2017 um 02:31 schrieb Ramsay Jones: On 15/07/17 21:20, René Scharfe wrote: Simplify the code by using the helper macros COPY_ARRAY and MOVE_ARRAY, which also makes them more robust in the case we copy or move no lines, as they allow using NULL points in that case, while memcpy(3) and

Re: [PATCH 3/2] apply: use COPY_ARRAY and MOVE_ARRAY in update_image()

2017-07-15 Thread Ramsay Jones
On 15/07/17 21:20, René Scharfe wrote: > Simplify the code by using the helper macros COPY_ARRAY and MOVE_ARRAY, > which also makes them more robust in the case we copy or move no lines, > as they allow using NULL points in that case, while memcpy(3) and > memmove(3) don't. > > Found with

[PATCH 3/2] apply: use COPY_ARRAY and MOVE_ARRAY in update_image()

2017-07-15 Thread René Scharfe
Simplify the code by using the helper macros COPY_ARRAY and MOVE_ARRAY, which also makes them more robust in the case we copy or move no lines, as they allow using NULL points in that case, while memcpy(3) and memmove(3) don't. Found with Clang's UBSan. Signed-off-by: Rene Scharfe