diff options
author | Mark Greer <mgreer@animalcreek.com> | 2017-02-16 17:08:50 +0000 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2017-11-10 00:15:10 +0100 |
commit | 047b0dff62ba02a619901fc24317a5dc6745dc24 (patch) | |
tree | cac653d62baf6ff873d1957c71e811cfe0b09bdd | |
parent | 7afe8460dce3275da71fa2ac8aa338deb373df34 (diff) | |
download | neard-047b0dff62ba02a619901fc24317a5dc6745dc24.tar.gz |
ndef: Fix use of uninitialized variable in property_get_type()
The 'type' variable in property_get_type() is never set when the
record type is invalid. This means that the check for NULL doesn't
work as it should and a bogus string can be appended. Fix this by
adding a default case to the switch statement that checks the record
type ensuring that 'type' is set to NULL when the record type is
invalid.
Signed-off-by: Mark Greer <mgreer@animalcreek.com>
-rw-r--r-- | src/ndef.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -342,6 +342,7 @@ static gboolean property_get_type(const GDBusPropertyTable *property, case RECORD_TYPE_WKT_ERROR: case RECORD_TYPE_UNKNOWN: case RECORD_TYPE_ERROR: + default: type = NULL; break; |