From 07413f34f17e28ff186b9ef078649d89131c1906 Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Thu, 12 May 2011 17:17:50 +0200 Subject: [PATCH] nfctype2: Do not read data if CC indicates a zero length --- plugins/nfctype2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/nfctype2.c b/plugins/nfctype2.c index d989a7a..4f3d476 100644 --- a/plugins/nfctype2.c +++ b/plugins/nfctype2.c @@ -164,6 +164,8 @@ static int meta_recv(uint8_t *resp, int length, void *data) tag->data_length = TAG_DATA_LENGTH(tag->cc); tag->data = g_try_malloc0(tag->data_length); + if (tag->data == NULL || tag->data_length = 0) + return -ENOMEM; return data_read(tag); } -- 2.7.4