Memory sanitizer: unitialized read
Reset all the circular buffer to zero; this ensures that we cannot read uninitialized data. Since this is RFsimulator, performance is not a problem here either (and zeroing out happens only once).
This commit is contained in:
@@ -179,7 +179,7 @@ typedef struct {
|
||||
static int allocCirBuf(rfsimulator_state_t *bridge, int sock)
|
||||
{
|
||||
buffer_t *ptr=&bridge->buf[sock];
|
||||
ptr->circularBuf = malloc(sampleToByte(CirSize, 1));
|
||||
ptr->circularBuf = calloc(1, sampleToByte(CirSize, 1));
|
||||
if (ptr->circularBuf == NULL) {
|
||||
LOG_E(HW, "malloc(%lu) failed\n", sampleToByte(CirSize, 1));
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user