Fix key_macing_length() return value when nbytes is 0.
This commit is contained in:
parent
5b55528008
commit
c9680fd7c7
2 changed files with 20 additions and 1 deletions
|
|
@ -236,7 +236,7 @@ key_macing_length (const MifareDESFireKey key)
|
|||
size_t
|
||||
padded_data_length (const size_t nbytes, const size_t block_size)
|
||||
{
|
||||
if (nbytes % block_size)
|
||||
if ((!nbytes) || (nbytes % block_size))
|
||||
return ((nbytes / block_size) + 1) * block_size;
|
||||
else
|
||||
return nbytes;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue