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 <[email protected]>
---
 src/ndef.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/ndef.c b/src/ndef.c
index b90205b..99f3bc3 100644
--- a/src/ndef.c
+++ b/src/ndef.c
@@ -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;
 
-- 
2.13.0

Reply via email to