[Pcsclite-muscle] [PATCH] fix racecondition between winscard server and clients

Florian Kaiser florian_kaiser at genua.de
Wed Dec 7 14:05:41 UTC 2016


Hi,

sorry to bother you again, but there is a small error in your upstream patch.


+				if (waStr.rv != SCARD_F_INTERNAL_ERROR)
+					WRITE_BODY(waStr)

WRITE_BODY is a Macro around two function calls. After the preprocessor ran 
the code would look something like this (the parameters are wrong here):

if (waStr.rv != SCARD_F_INTERNAL_ERROR)
log_msg(priority, "%s:%d:%s() " fmt, __FILE__, __LINE__, __FUNCTION__, data1, 
data2, data3);
ret = MessageSend(&v, sizeof(v), filedes);

Now the if-statement only affects the log_msg function call, so the curly 
brackets are required around this kind of macro...

I have attached a patch, which secures this macro and prevents errors like 
this.

Thanks a lot

Florian Kaiser


On Tuesday, December 06, 2016 04:56:09 PM Ludovic Rousseau wrote:
> 2016-12-03 19:55 GMT+01:00 Ludovic Rousseau <ludovic.rousseau at gmail.com>:
> > 2016-11-30 13:26 GMT+01:00 Florian Kaiser <florian_kaiser at genua.de>:
> >> Hi,
> > 
> > Hello,
> > 
> >> this change fixes a racecondition between a winscard server and clients.
> >> Feel free to message me, if my explanation below is not sufficient. I
> >> will try to provide more Information in this case.
> > 
> > Do you have a sample code or an easy way to reproduce the problem?
> 
> Fixed in revision
> https://github.com/LudovicRousseau/PCSC/commit/4e2a563c8ed4353ad013de85b71aa
> c12ec599f82
> 
> Thanks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pcsc-macros.patch
Type: text/x-patch
Size: 8930 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pcsclite-muscle/attachments/20161207/c32b54c4/attachment.bin>


More information about the Pcsclite-muscle mailing list