mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 22:03:42 -07:00
coverity fix 279922 , div by zero
This commit is contained in:
parent
ae14272117
commit
7303dd8c5d
1 changed files with 4 additions and 0 deletions
|
@ -281,6 +281,10 @@ void cmac_generate_subkeys(desfirekey_t key) {
|
||||||
|
|
||||||
void cmac(const desfirekey_t key, uint8_t *ivect, const uint8_t *data, size_t len, uint8_t *cmac) {
|
void cmac(const desfirekey_t key, uint8_t *ivect, const uint8_t *data, size_t len, uint8_t *cmac) {
|
||||||
int kbs = key_block_size(key);
|
int kbs = key_block_size(key);
|
||||||
|
if (kbs == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t *buffer = malloc(padded_data_length(len, kbs));
|
uint8_t *buffer = malloc(padded_data_length(len, kbs));
|
||||||
|
|
||||||
memcpy(buffer, data, len);
|
memcpy(buffer, data, len);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue