#include "config.h"
#endif
+#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
#include <strings.h>
-#include <pthread.h>
-#include <semaphore.h>
#define BOOL PCSC_BOOL
#include <PCSC/pcsclite.h>
}
else
{
+ assert(NULL != buffer);
if (header < length)
length = header;
(unsigned) cur->pvUserData, (unsigned) cur->dwCurrentState,
(unsigned) cur->dwEventState);
+ if (!cur->szReader)
+ {
+ DEBUG_WARN("cur->szReader=%p", cur->szReader);
+ continue;
+ }
if (strcmp(cur->szReader, "\\\\?PnP?\\Notification") == 0)
cur->dwCurrentState |= SCARD_STATE_IGNORE;
}
Stream_Write_UINT32(irp->output, 0); /* pioRecvPci 0x00; */
- smartcard_output_buffer_start(irp, cbRecvLength); /* start of recvBuf output */
-
- smartcard_output_buffer(irp, (char*) recvBuf, cbRecvLength);
+ if (recvBuf)
+ {
+ smartcard_output_buffer_start(irp, cbRecvLength); /* start of recvBuf output */
+ smartcard_output_buffer(irp, (char*) recvBuf, cbRecvLength);
+ }
}
smartcard_output_alignment(irp, 8);
- free(sendBuf);
- free(recvBuf);
+ if (sendBuf)
+ free(sendBuf);
+ if (recvBuf)
+ free(recvBuf);
return status;
}
(unsigned) cur->pvUserData, (unsigned) cur->dwCurrentState,
(unsigned) cur->dwEventState);
+ if (!cur->szReader)
+ {
+ DEBUG_WARN("cur->szReader=%p", cur->szReader);
+ continue;
+ }
if (strcmp(cur->szReader, "\\\\?PnP?\\Notification") == 0)
cur->dwCurrentState |= SCARD_STATE_IGNORE;
}