14 Dec
2007
14 Dec
'07
1:04 p.m.
Marcus Meissner <meissner(a)suse.de> writes:
- lstrcpynW( num, begin + 1, end - begin ); - begin += end - begin + 1; + + xcnt = end - begin; + if (xcnt > sizeof(num)/sizeof(WCHAR)) + xcnt = sizeof(num)/sizeof(WCHAR); + lstrcpynW( num, begin + 1, xcnt ); + begin += xcnt + 1;
Truncating the string is not a correct fix. Overflow should either be treated as an error, or a buffer should be allocated dynamically. -- Alexandre Julliard julliard(a)winehq.org