Fixed invalid memory read, removed dead code
authorErich Keane <erich.keane@intel.com>
Wed, 7 Jan 2015 21:23:25 +0000 (13:23 -0800)
committerErich Keane <erich.keane@intel.com>
Wed, 7 Jan 2015 21:23:25 +0000 (13:23 -0800)
commit04f6cb83d6cf943aef2c29ac60dbe575299b61df
treef10a73dbee6ec560e97ebf3471d41afff849b9e4
parent6742730237bdbe58c75abdca84abbd2162c4e731
Fixed invalid memory read, removed dead code

Debug.c's coap_print_addr had its functionality completely removed
in the past.  However, this resulted in returning SOMETHING (not zero!)
despite not actually correctly writing to the addr parameter.

Since this parameter is uninitialized when sent to this function,
and the return value is used to determine whether it correctly added
info to the addr, the debug print following this (net.c:972) attempted
to read the uninitialized data, potentially causing memory corruption.

This fix removes the 'dead' code, then returns a zero (failure, nothing
written).

Change-Id: If4f2c131d9b2f585299363f21c3686c25de29104
Signed-off-by: Erich Keane <erich.keane@intel.com>
resource/csdk/libcoap-4.1.1/debug.c