Issue #13

0 up
0 down
Open
jerasure/gf-complete#13
Created by Loic Dachary

LOG_ZERO_EXT has undefined entries in the log table

As demonstrated with

../libtool --mode=execute valgrind --quiet --error-exitcode=1 --gen-suppressions=yes --tool=memcheck ../test/gf_unit 8 A -1 -m LOG_ZERO_EXT -
Args: 8 A -1 -m LOG_ZERO_EXT - / size (bytes): 1728
==23439== Conditional jump or move depends on uninitialised value(s)
==23439==    at 0x401EBF: main (gf_unit.c:346)
==23439== 
==23439== 

which does not show if

@@ -482,6 +482,7 @@ int gf_init_hard(gf_t *gf, int w, int mult_type,

   if (scratch_memory == NULL) {
     h = (gf_internal_t *) malloc(sz);
+    memset(h, '\0', sz);
     h->free_me = 1;
   } else {
     h = scratch_memory;

meaning int gf_w8_log_init(gf_t *gf) does not cover all entries when h->mult_type == GF_MULT_LOG_ZERO

Assignee: None
Milestone: None
1 participant