Aug. 18, 2014
2:44 p.m.
walter harms wrote:
maybe lclptr = calloc(sizeof *lclptr,1); ? that would remove the need for lclptr->leapcnt = 0; etc. any information leak via padding bytes would be closed also.
Sorry, I don't see the information leak here, as lclptr is static and does not escape to calling code. More generally, the current code always uses malloc to allocate objects dynamically, and switching to calloc would be a pragmatics change that should be done as a separate patch. I'm not entirely sold on the idea of using calloc to avoid leaking information from previous uses of the memory. If information leakage is a concern, surely it's better to use a malloc wrapper that clears memory rather than to manually inspect and modify every call to malloc.