From 70bfc77161e496357ae60f3e260121ad6ae0821e Mon Sep 17 00:00:00 2001
From: Jouni Malinen <j@w1.fi>
Date: Mon, 30 Jun 2014 01:44:33 +0300
Subject: [PATCH] PCSC: Debug print extra response data

This shows any extra data from USIM response and also avoids a static
analyzer warning on dead increment.

Signed-off-by: Jouni Malinen <j@w1.fi>
---
 src/utils/pcsc_funcs.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/utils/pcsc_funcs.c b/src/utils/pcsc_funcs.c
index ec0655634..d955dc4e1 100644
--- a/src/utils/pcsc_funcs.c
+++ b/src/utils/pcsc_funcs.c
@@ -1406,6 +1406,12 @@ int scard_umts_auth(struct scard_data *scard, const unsigned char *_rand,
 		pos += IK_LEN;
 		wpa_hexdump(MSG_DEBUG, "SCARD: IK", ik, IK_LEN);
 
+		if (end > pos) {
+			wpa_hexdump(MSG_DEBUG,
+				    "SCARD: Ignore extra data in end",
+				    pos, end - pos);
+		}
+
 		return 0;
 	}