wininet: don't evaluate netconn_get_avail_data() twice in netconn_read()
dank at kegel.com
Sat Jul 7 19:34:52 CDT 2012
Using netconn_get_avail_data() in min() is funky, don't do it.
min() is a macro which evaluates its right hand argument twice,
which is not only extra work, it also might return different values
on the two calls, leading to min() sometimes returning a
larger value than either of its 'two' inputs.
Also added an assertion that makes the problem obvious.
Thanks to Sami Aario for spotting the overrun.
Fixes http://bugs.winehq.org/show_bug.cgi?id=27090 and
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1655 bytes
Desc: not available
More information about the wine-patches