diff options
| author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2006-11-17 13:46:14 +0000 | 
|---|---|---|
| committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2006-11-17 13:46:14 +0000 | 
| commit | ddc45a5a00c22b5a9b2c86afa9b06381a48673fb (patch) | |
| tree | ed53edd5dda4560bc3e5ffc0776099ffaef1f5ef | |
| parent | 118f6f9f013b38afc5b65dd0e4de97e9baad07e6 (diff) | |
Check if the service path is valid: Avoid seg fault when there isn't D-Bus data assigned to the path
| -rw-r--r-- | hcid/dbus-security.c | 6 | 
1 files changed, 6 insertions, 0 deletions
diff --git a/hcid/dbus-security.c b/hcid/dbus-security.c index b15885b3..c197f7f3 100644 --- a/hcid/dbus-security.c +++ b/hcid/dbus-security.c @@ -774,6 +774,9 @@ static DBusHandlerResult authorize_service(DBusConnection *conn,  						(void *) &sagent))  		return error_rejected(conn, msg); +	if (!sagent) +		return error_service_does_not_exist(conn, msg); +  	if (strcmp(dbus_message_get_sender(msg), sagent->id))  		return error_rejected(conn, msg); @@ -837,6 +840,9 @@ static DBusHandlerResult cancel_authorization_process(DBusConnection *conn,  						(void *) &sagent))  		return error_not_authorized(conn, msg); +	if (!sagent) +		return error_service_does_not_exist(conn, msg); +  	if (strcmp(dbus_message_get_sender(msg), sagent->id))  		return error_not_authorized(conn, msg);  | 
