From 67ba28e86db29ac90e21e4a0471eb2b8d1ff1350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Fri, 4 Apr 2014 17:37:00 -0400 Subject: [PATCH] libwinpr-smartcard: ListReaders_Call fix --- .../smartcard/client/smartcard_operations.c | 1 - channels/smartcard/client/smartcard_pack.c | 17 +++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/channels/smartcard/client/smartcard_operations.c b/channels/smartcard/client/smartcard_operations.c index ac6c270c9..d054c8621 100644 --- a/channels/smartcard/client/smartcard_operations.c +++ b/channels/smartcard/client/smartcard_operations.c @@ -763,7 +763,6 @@ static UINT32 handle_ListReaders(SMARTCARD_DEVICE* smartcard, IRP* irp, BOOL wid if (status) goto finish; - /* Read RedirScardcontextRef */ status = handle_RedirContextRef(smartcard, irp, redirect, &hContext); if (status) diff --git a/channels/smartcard/client/smartcard_pack.c b/channels/smartcard/client/smartcard_pack.c index ee4fe0458..255024cdc 100644 --- a/channels/smartcard/client/smartcard_pack.c +++ b/channels/smartcard/client/smartcard_pack.c @@ -21,6 +21,9 @@ #include "config.h" #endif +#include +#include + #include "smartcard_pack.h" UINT32 smartcard_unpack_establish_context_call(SMARTCARD_DEVICE* smartcard, wStream* s, EstablishContext_Call* call) @@ -55,16 +58,8 @@ UINT32 smartcard_unpack_list_readers_call(SMARTCARD_DEVICE* smartcard, wStream* return SCARD_F_INTERNAL_ERROR; } - if (call->cBytes) - { - call->mszGroups = malloc(call->cBytes); - Stream_Read(s, call->mszGroups, call->cBytes); /* mszGroups */ - } - else - { - call->mszGroups = NULL; - Stream_Seek(s, 4); /* mszGroups */ - } + call->mszGroups = NULL; + Stream_Seek(s, 4); /* mszGroupsPtr (4 bytes) */ Stream_Read_UINT32(s, call->fmszReadersIsNULL); /* fmszReadersIsNULL (4 bytes) */ Stream_Read_UINT32(s, call->cchReaders); /* cchReaders (4 bytes) */ @@ -76,5 +71,7 @@ UINT32 smartcard_unpack_list_readers_call(SMARTCARD_DEVICE* smartcard, wStream* return SCARD_F_INTERNAL_ERROR; } + /* FIXME: complete parsing */ + return SCARD_S_SUCCESS; }