On 2026-02-22 22:50, Bruno Haible wrote:
Paul Eggert wrote:
The ‘BLOCKSIZE + 72’ business apparently dates back to 30 years
ago when the buffer was local (not heap allocated) and was multi-use.
That code died long ago

Are you sure? For 30 minutes, I'm trying to determine at which commit
the use of these extra bytes was removed from
    lib/md5.c
    lib/md5-stream.c
and I can't find it.

That use was never present in Gnulib as far as I know. I vaguely recall the use was present in glibc decades ago, but I can't find its use even there in the glibc git.


The line in lib/md5.c, function md5_finish_ctx,

   memcpy (&((char *) ctx->buffer)[bytes], fillbuf, (size - 2) * 4 - bytes);

still looks like it needs at least 64 bytes beyond BLOCKSIZE. No?

That ctx->buffer has 128 bytes, not BLOCKSIZE (or BLOCKSIZE + 72) bytes. The buffer allocated with BLOCKSIZE bytes is not visible in that function, so even if we allocated it with BLOCKSIZE + 72 bytes, that would not make a difference to that function.


Reply via email to