In case a radio exists, but is disabled, the survey request will return
successfully, but without data.
The code could not handle this case, as the newest_element_index would
be negative in this case, leading to json_object_array_get_idx returning
a null-pointer.
Check for a null pointer prior adding the PHY index, avoiding a
null-pointer dereference.
Signed-off-by: David Bauer <mail@david-bauer.net>
The noise value delivered by nl80211 is actually a signed int8. Thus it
must be interpreted as a signed value, too.
Signed-off-by: Tobias Schramm <tobleminer@gmail.com>