FIX: Coverity Scans complain about uninitialized usage of struct. Setting s->ODD and s->EVEN to zero should do the trick.

This commit is contained in:
iceman1001 2016-01-20 11:31:24 +01:00
commit bf22fab73b
5 changed files with 5 additions and 0 deletions

View file

@ -24,6 +24,7 @@
void crypto1_create(struct Crypto1State *s, uint64_t key) void crypto1_create(struct Crypto1State *s, uint64_t key)
{ {
// struct Crypto1State *s = malloc(sizeof(*s)); // struct Crypto1State *s = malloc(sizeof(*s));
s->odd = s->even = 0;
int i; int i;
for(i = 47;s && i > 0; i -= 2) { for(i = 47;s && i > 0; i -= 2) {

View file

@ -687,6 +687,7 @@ static void Check_for_FilterFlipProperties(void)
static void simulate_MFplus_RNG(uint32_t test_cuid, uint64_t test_key, uint32_t *nt_enc, uint8_t *par_enc) static void simulate_MFplus_RNG(uint32_t test_cuid, uint64_t test_key, uint32_t *nt_enc, uint8_t *par_enc)
{ {
struct Crypto1State sim_cs; struct Crypto1State sim_cs;
sim_cs.odd = sim_cs.even = 0;
// init cryptostate with key: // init cryptostate with key:
for(int8_t i = 47; i > 0; i -= 2) { for(int8_t i = 47; i > 0; i -= 2) {

View file

@ -23,6 +23,7 @@
struct Crypto1State * crypto1_create(uint64_t key) struct Crypto1State * crypto1_create(uint64_t key)
{ {
struct Crypto1State *s = malloc(sizeof(*s)); struct Crypto1State *s = malloc(sizeof(*s));
s->odd = s->even = 0;
int i; int i;
for(i = 47;s && i > 0; i -= 2) { for(i = 47;s && i > 0; i -= 2) {

View file

@ -23,6 +23,7 @@
struct Crypto1State * crypto1_create(uint64_t key) struct Crypto1State * crypto1_create(uint64_t key)
{ {
struct Crypto1State *s = malloc(sizeof(*s)); struct Crypto1State *s = malloc(sizeof(*s));
s->odd = s->even = 0;
int i; int i;
for(i = 47;s && i > 0; i -= 2) { for(i = 47;s && i > 0; i -= 2) {

View file

@ -23,6 +23,7 @@
struct Crypto1State * crypto1_create(uint64_t key) struct Crypto1State * crypto1_create(uint64_t key)
{ {
struct Crypto1State *s = malloc(sizeof(*s)); struct Crypto1State *s = malloc(sizeof(*s));
s->odd = s->even = 0;
int i; int i;
for(i = 47;s && i > 0; i -= 2) { for(i = 47;s && i > 0; i -= 2) {