Fix creation of Exec path for files not in prefix
authorMilan Crha <mcrha redhat com>
Fri, 18 Sep 2015 15:22:29 +0000 (16:22 +0100)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Wed, 30 Sep 2015 14:36:37 +0000 (15:36 +0100)
commit171cdd50fb153c355b70bec8da5181e0b523dbd2
treeb79378bf8c8972158ebca55e36e1276699b73f02
parent36d864e4697bc6e1eeffb32092bd78b108362ab5
Fix creation of Exec path for files not in prefix

Doing strcat() into a static buffer produces incorrect results for
the second and subsequent services if they are not in the ${prefix};
for example, if the first call should have returned
"C:\bar\bin\service1" and the second should have returned
"C:\bar\bin\service2", the second result would actually be
"C:\bar\bin\service1C:\bar\bin\service2".

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83539
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
[smcv: added commit message; used strncpy/strncat to avoid overflow]
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
dbus/dbus-sysdeps-util-win.c