win32 dbus-launch.bat replacement

Thiago Macieira thiago at kde.org
Sat May 26 01:03:26 PDT 2007


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.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20070526/c85c2a97/attachment.pgp 


More information about the dbus mailing list