winscard_msg.c contained a serious design flaw. it assumed that after the
select indicates that socket is readable one can read the full structure
from it. it's not so. read can return partial results, which means that
some fields of the readed structure contain garbage and if you use them
they may crash your program. we found this bug on heavily loaded machine
where partial reads and writes on unix domain socket are quite common.
i've added patch that implements read and write as small loop around
select and read/write that completes when all data is readed or written or
when timeout occures. i also switched to nonblocking sockets.
i would like to remove the callback stuff from the connection setup
routine too if there is no good excuse for it.
arne
winscard_msg.c.diff