crypto/poly1305: Fix false positive '-Wstringop-overflow' warning in poly1305.c

poly1305.c:241:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  241 |           st->buffer[st->leftover + i] = m[i];
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
Signed-off-by: makejian <makejian@xiaomi.com>
This commit is contained in:
makejian 2023-12-19 21:21:38 +08:00 committed by Alan Carvalho de Assis
parent c812007f8c
commit 7c763f67a6

View file

@ -236,9 +236,9 @@ void poly1305_update(FAR poly1305_state *st,
if (bytes) if (bytes)
{ {
for (i = 0; i < bytes; i++) for (i = 0; i < bytes && i < poly1305_block_size; i++)
{ {
st->buffer[st->leftover + i] = m[i]; st->buffer[i] = m[i];
} }
st->leftover += bytes; st->leftover += bytes;