16 Mar
2005
16 Mar
'05
7:26 p.m.
Ann and Jason Edmeades wrote:
WCHAR *p = ALLOC_N_OBJ(WCHAR, nLen+1); #define ALLOC_N_OBJ(type, count) (type *)HeapAlloc(me_heap, 0, count*sizeof(type))
That is so embarrasing! They teach this in the nursery school :/ By coincidence, I've spent at least half an hour today on finding the memory overwrite elsewhere, which turned out to be caused by the bug above. The buffer overrun comment refers to something else - I'm not sure if WideCharToMultiByte will produce single byte character string for ANSI codepages. If it produced a real multibyte string, it could exceed the buffer supplied by the application. Krzysztof
7578
Age (days ago)
7578
Last active (days ago)
0 comments
1 participants
participants (1)
-
Krzysztof Foltman