win32 dbus-launch.bat replacement
Ralf Habacker
ralf.habacker at freenet.de
Sat May 26 07:28:04 PDT 2007
Thiago Macieira schrieb:
> Ralf Habacker wrote:
>
>> if ((p = strrchr(dbusDaemonPath,'\\'))) {
>> *(p+1)= '\0';
>> strcat(dbusDaemonPath,"dbus-daemon.exe");
>> }
>>
>
> This and all other sections like it have the problem of buffer overruns.
>
> dbusDaemonPath is MAX_PATH bytes in length, but if the GetModuleFileName
> syscall returns something more than MAX_PATH-15, you'll overrun the end
> of the buffer when you do strcat.
>
Then allocating MAX_PATH*2 should solve the problem for any case ?
Ralf
More information about the dbus
mailing list