mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-28 18:28:23 -05:00
Make sha256_process() easier for static analyzers
md->curlen cannot indicate full buffer size here since the buffered data is processed whenever the full block size of data is available. Avoid invalid warnings from static analyzers on memcpy() outside the buffer length by verifying that curlen is smaller than block size. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
94a9ebb0b2
commit
7f6400ed19
@ -164,7 +164,7 @@ static int sha256_process(struct sha256_state *md, const unsigned char *in,
|
||||
unsigned long n;
|
||||
#define block_size 64
|
||||
|
||||
if (md->curlen > sizeof(md->buf))
|
||||
if (md->curlen >= sizeof(md->buf))
|
||||
return -1;
|
||||
|
||||
while (inlen > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user