From bb039e933bea5b6879026b2eb2b83a46a6e23715 Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Thu, 2 Nov 2006 11:09:35 +0000 Subject: [PATCH] move response-limitation to a more appropriate place git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1316 423420c4-83ab-492f-b58f-81f9feb106b5 --- scard.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/scard.c b/scard.c index c5b5060..6444a28 100644 --- a/scard.c +++ b/scard.c @@ -1509,16 +1509,6 @@ TS_SCardTransmit(STREAM in, STREAM out) if (cbRecvLength) { - /* FIXME: handle responses with length > 448 bytes */ - if (cbRecvLength > 448) - { -#ifdef WITH_SCARD_DEBUG - printf("[RECV LEN %d -> %d]\n", (unsigned int) cbRecvLength, 400); -#endif - cbRecvLength = 448; - } - - recvBuf = SC_xmalloc(&lcHandle, cbRecvLength); if (!recvBuf) return SC_returnNoMemoryError(&lcHandle, in, out); @@ -1598,6 +1588,17 @@ TS_SCardTransmit(STREAM in, STREAM out) rv = SCardTransmit(myHCard, myPioSendPci, sendBuf, (MYPCSC_DWORD) cbSendLength, myPioRecvPci, recvBuf, &myCbRecvLength); cbRecvLength = myCbRecvLength; + + /* FIXME: handle responses with length > 448 bytes */ + if (cbRecvLength > 448) + { + warning("Card response limited from %d to 448 bytes!\n", cbRecvLength); +#ifdef WITH_SCARD_DEBUG + printf("[RECV LEN %d -> %d]\n", (unsigned int) cbRecvLength, 400); +#endif + cbRecvLength = 448; + } + if (pioRecvPci) { copyIORequest_MyPCSCToServer(myPioRecvPci, pioRecvPci);