Hi Bruno,

Thank you for explaining how those buffers work.

Best regards,
Mark Esler

On Fri, Aug 19, 2022 at 11:26 PM Bruno Haible <br...@clisp.org> wrote:
>
> Mark Esler wrote:
> > I believe Gnulib contains memcpy calls on overlapping memory and that
> > commit 3e7178b337e3a83df9e4f36a4aef516f089e3796 was incomplete.
> >
> > Please see https://gitlab.com/gsasl/gsasl/-/issues/4 for details.
>
> The comment from [1] is correct.
>
> Your statement "If left_over >= 16, memcpy will overwrite the source
> as it is being copied." is incorrect.
>
> ctx->buffer and &ctx->buffer[16] differ by 16 units, each unit being
> uint32_t, that is 4 bytes wide. So these pointers differ by 64 bytes.
> Since left_over ≤ 64, there is no overlap.
>
> Bruno
>
> [1] 
> https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=3e7178b337e3a83df9e4f36a4aef516f089e3796
>
>
>

Reply via email to