mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-08 20:48:02 +02:00
Fix buffer underrun and clarify condition.
This commit is contained in:
parent
983cca443d
commit
30af0a1c5f
1 changed files with 5 additions and 2 deletions
|
|
@ -3187,10 +3187,13 @@ _dbus_get_install_root(char *prefix, int len)
|
|||
//folder's name happens to end with the *bytes*
|
||||
//"\\bin"... (I.e. the second byte of some Han character and then
|
||||
//the Latin "bin", but that is not likely I think...
|
||||
if (lastSlash - prefix > 3 && strncmp(lastSlash - 4, "\\bin", 4) == 0)
|
||||
if (lastSlash - prefix >= 4 && strncmp(lastSlash - 4, "\\bin", 4) == 0)
|
||||
lastSlash[-3] = 0;
|
||||
else if (lastSlash - prefix > 3 && (strncmp(lastSlash - 10, "\\bin\\Debug", 10) == 0 || strncmp(lastSlash - 10, "\\bin\\Release", 10) == 0))
|
||||
else if (lastSlash - prefix >= 10 && strncmp(lastSlash - 10, "\\bin\\Debug", 10) == 0)
|
||||
lastSlash[-9] = 0;
|
||||
else if (lastSlash - prefix >= 12 && strncmp(lastSlash - 12, "\\bin\\Release", 12) == 0)
|
||||
lastSlash[-11] = 0;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue