mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 13:18:50 +08:00
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:
parent
c812007f8c
commit
7c763f67a6
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue