Re: fix overflow in several advapi32 crypt functions hidden by broken WideCharToMultiByte

2009-07-04 Thread James McKenzie
Christoph von Wittich wrote: As Dmitry wrote about this, I will add the comment that this does not look like the proper way to fix this problem. The proper way is to keep the pointer from overflowing in the first place and that would be to place a check where it is set and updated to either go ne

Re: fix overflow in several advapi32 crypt functions hidden by broken WideCharToMultiByte

2009-07-02 Thread Detlef Riekenberg
On Mo, 2009-06-29 at 16:49 +0900, Dmitry Timoshkov wrote: > "Christoph von Wittich" wrote: > > > + if (*pcbProvName > INT_MAX) > > + *pcbProvName = INT_MAX; > > In which way WideCharToMultiByte is broken? It always helps to provide > an explanation and if possible a test case. While working on

Re: fix overflow in several advapi32 crypt functions hidden by broken WideCharToMultiByte

2009-06-29 Thread Dmitry Timoshkov
"Christoph von Wittich" wrote: When you would have a look at the winetests you would have noticed two failures about passing in negative values... Which winetests should I look at? The WideCharToMultiByte ones? Then the patch is wrong. That's unusual to expect that somebody reads your mind.

Re: fix overflow in several advapi32 crypt functions hidden by broken WideCharToMultiByte

2009-06-29 Thread Dmitry Timoshkov
"Christoph von Wittich" wrote: + if (*pcbProvName > INT_MAX) + *pcbProvName = INT_MAX; In which way WideCharToMultiByte is broken? It always helps to provide an explanation and if possible a test case. -- Dmitry.