drivers: crypto: crypto_ataes132a fix memset undefined behavior
Coverity reported a memory - illegal accesses when using memset in
ataes132a_aes_ecb_block(). This can happen when the input block is
exactly 16 bytes: memset(¶m_buffer[19], 0x0, 0) is called. But this
is an undefined behaviour in C even if size is 0, as ¶m_buffer[19]
is an invalid pointer.
The fix consists of simply skipping memset() in this case, since there's
nothing to zero out.
Coverity CID: 434642
Signed-off-by:
Loic Domaigne <tech@domaigne.com>
Loading
Please sign in to comment