DBusConnection: Validate the path sent to the _Introspect() method, to replace a crash by an error or a void result.
[GB.DBUS] * BUG: DBusConnection: Validate the path sent to the _Introspect() method, to replace a crash by an error or a void result.
This commit is contained in:
parent
1bf591abe6
commit
48f84df846
3 changed files with 14 additions and 2 deletions
|
@ -102,6 +102,12 @@ BEGIN_METHOD(DBusConnection_Introspect, GB_STRING application; GB_STRING object)
|
|||
else
|
||||
object = "/";
|
||||
|
||||
if (DBUS_validate_path(object, LENGTH(object)))
|
||||
{
|
||||
GB.Error("Invalid object path");
|
||||
return;
|
||||
}
|
||||
|
||||
GB.ReturnNewZeroString(DBUS_introspect(THIS->connection, application, object));
|
||||
|
||||
END_METHOD
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Gambas Project File 3.0
|
||||
Title=gb.dbus
|
||||
Startup=MMain
|
||||
Version=3.14.90
|
||||
Version=3.15.90
|
||||
VersionFile=1
|
||||
Component=gb.dbus
|
||||
TabSize=2
|
||||
|
|
|
@ -139,7 +139,7 @@ Public Sub Main1()
|
|||
|
||||
End
|
||||
|
||||
Public Sub Main()
|
||||
Public Sub Main4()
|
||||
|
||||
Dim hDBusApplication As DBusApplication
|
||||
Dim hDBusProxy As DBusProxy
|
||||
|
@ -152,3 +152,9 @@ Public Sub Main()
|
|||
Print hDBusProxy.State() 'Should be invalid
|
||||
|
||||
End
|
||||
|
||||
Public Sub Main()
|
||||
|
||||
Print DBus["org.freedesktop.DBus"]._Introspect("/a")
|
||||
|
||||
End
|
||||
|
|
Loading…
Reference in a new issue