On 01/08/2014 04:04 AM, Laine Stump wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=1046594
If the call to get_augeas() at the top of aug_get_mac() failed, we would goto error and FREE(path), which would not have been initialized. And if by some magic of fate we happened to get past that, we would return garbage for the return code, since r was also not initialized. This patch initializes both path and r to fix the crash documented in Bug 1046594.
Although it doesn't directly impact the referenced bug, a quick audit of other functions in the same file showed that defnode() had the same problem with uninitialized "r". Beyond that, I also defensively initialized the pointer to mac address to NULL both in aug_get_mac() as well as two of its callers, to make future audits of the code easier, and to shut up both valgrind and whatever static analyzers might be run on the code.
src/drv_redhat.c | 4 ++-- src/drv_suse.c | 4 ++-- src/dutil_linux.c | 9 +++++---- 3 files changed, 9 insertions(+), 8 deletions(-)
ACK