FIX: coverty scan reveals some resourceleaks and overruns, which is supposed to be fixed now.

/armsrc/des.c   overflow 7 instead of 6
/client/cmdlfhitag.c  overflows traclen
/client/util.c   sprint_bin_break  overflows.
/client/cmdhficlass.c   need to free memory after malloc.

ADD:  RotateRight macro in util.h
This commit is contained in:
iceman1001 2016-01-08 14:25:10 +01:00
commit ab7bb49475
5 changed files with 10 additions and 7 deletions

View file

@ -274,7 +274,7 @@ uint32_t des_f(uint32_t r, uint8_t* kr){
uint64_t data;
uint8_t *sbp; /* sboxpointer */
permute((uint8_t*)e_permtab, (uint8_t*)&r, (uint8_t*)&data);
for(i=0; i<7; ++i)
for(i=0; i<6; ++i)
((uint8_t*)&data)[i] ^= kr[i];
/* Sbox substitution */