4 Jun
2019
4 Jun
'19
4:20 p.m.
On 6/4/19 10:56 AM, Alexandre Julliard wrote:
Zebediah Figura <zfigura(a)codeweavers.com> writes:
+ DWORD len;
- if ((dst = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)))) - sprintfW(dst, formatW, ext->busid, ext->vid, ext->pid); + if (ext->input == (WORD)-1) + { + len = snprintfW(NULL, 0, formatW, ext->busid, ext->vid, ext->pid);
This can't work, snprintfW returns -1 on overflow.
...Indeed. I'm not sure why it worked for me, then. I guess there's no way to get the real buffer size using this approach? I'll resend using a fixed-size buffer.