Re: [PATCH 1/2] kernel/tests: Implement safe local strcat function.

2006-07-04 Thread Saulius Krasuckas
* On Wed, 5 Jul 2006, Dmitry Timoshkov wrote: > * "Saulius Krasuckas" wrote: > > > > > strcat wrapper creates an illusion that it solves some problem when > > > it actually doesn't. > > > > So you agree there is a problem which isn't solved in current test > > code? > > I have no idea how it's

Re: [PATCH 1/2] kernel/tests: Implement safe local strcat function.

2006-07-04 Thread Dmitry Timoshkov
"Saulius Krasuckas" <[EMAIL PROTECTED]> wrote: strcat wrapper creates an illusion that it solves some problem when it actually doesn't. So you agree there is a problem which isn't solved in current test code? I have no idea how it's possible to make such a conclusion from what I've said. --

Re: [PATCH 1/2] kernel/tests: Implement safe local strcat function.

2006-07-04 Thread Saulius Krasuckas
* On Tue, 4 Jul 2006, Dmitry Timoshkov wrote: > * "Saulius Krasuckas" wrote: > > > > It was one "if" that I removed in my patch. Maybe you mean this way? > > Yes, that's a perfect way of checking for a possible buffer overflow, > there is no need to complicate things. It may be perfect from so

Re: [PATCH 1/2] kernel/tests: Implement safe local strcat function.

2006-07-04 Thread Dmitry Timoshkov
"Saulius Krasuckas" <[EMAIL PROTECTED]> wrote: There are other ways to achieve that. Once Alexandre already commented out an almost the same approach someone tried to port from ReactOS to Wine. Hm, I don't remember this. Can you give me an example of a nice way, please? It was one "if" tha

Re: [PATCH 1/2] kernel/tests: Implement safe local strcat function.

2006-07-04 Thread Saulius Krasuckas
* On Tue, 4 Jul 2006, Dmitry Timoshkov wrote: > * "Saulius Krasuckas" <[EMAIL PROTECTED]> wrote: > > > > By "safe" I meant it doesn't overflow buffer. Does it do? > > There are other ways to achieve that. Once Alexandre already commented > out an almost the same approach someone tried to port f

Re: [PATCH 1/2] kernel/tests: Implement safe local strcat function.

2006-07-04 Thread Dmitry Timoshkov
"Saulius Krasuckas" <[EMAIL PROTECTED]> wrote: By "safe" I meant it doesn't overflow buffer. Does it do? There are other ways to achieve that. Once Alexandre already commented out an almost the same approach someone tried to port from ReactOS to Wine. But well, would your reactions was the t

Re: [PATCH 1/2] kernel/tests: Implement safe local strcat function.

2006-07-04 Thread Saulius Krasuckas
* On Tue, 4 Jul 2006, Dmitry Timoshkov wrote: > * "Saulius Krasuckas" <[EMAIL PROTECTED]> wrote: > > > +static void safe_strcatA(char *dst, DWORD dst_len, const char *src) > > +{ > > +UINT length; > > +char *buff; > > + > > +length = lstrlenA(dst); > > +length += lstrlenA(src); > >

Re: [PATCH 1/2] kernel/tests: Implement safe local strcat function.

2006-07-04 Thread Dmitry Timoshkov
"Saulius Krasuckas" <[EMAIL PROTECTED]> wrote: +static void safe_strcatA(char *dst, DWORD dst_len, const char *src) +{ +UINT length; +char *buff; + +length = lstrlenA(dst); +length += lstrlenA(src); +buff = HeapAlloc(GetProcessHeap(), 0, length + 1); + +lstrcpyA(buff, dst