diff mbox

[03/23] ndef: Unrecognized WKTs should return RECORD_TYPE_UNKNOWN

Message ID 20170615182516.4508-4-mgreer@animalcreek.com (mailing list archive)
State Accepted
Delegated to: Samuel Ortiz
Headers show

Commit Message

Mark Greer June 15, 2017, 6:24 p.m. UTC
When get_record_type() doesn't recognize the record type in a record
with a Well Known Type TNF, it falls through to the next case clause
and returns RECORD_TYPE_MIME_TYPE.  This is incorrect so add a break
statement to the RECORD_TNF_WELLKNOWN case so that RECORD_TYPE_UNKNOWN
is returned.

Signed-off-by: Mark Greer <mgreer@animalcreek.com>
---
 src/ndef.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/src/ndef.c b/src/ndef.c
index 99f3bc3..03d6b13 100644
--- a/src/ndef.c
+++ b/src/ndef.c
@@ -928,6 +928,7 @@  static enum record_type get_record_type(enum record_tnf tnf,
 				return RECORD_TYPE_UNKNOWN;
 
 		}
+		break;
 
 	case RECORD_TNF_MIME:
 		return RECORD_TYPE_MIME_TYPE;