2012-05-22 12:12:36

by Mikel Astiz

[permalink] [raw]
Subject: [PATCH BlueZ v0] gdbus: Fix incorrectly discarded signals

From: Mikel Astiz <[email protected]>

Signals with no arguments were incorrectly filtered out due to the NULL
inequality check.
---
gdbus/object.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gdbus/object.c b/gdbus/object.c
index 2dd7c0e..c33df57 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -616,7 +616,7 @@ static gboolean check_signal(DBusConnection *conn, const char *path,
}
}

- if (*args == NULL) {
+ if (!signal || !signal->name) {
error("No signal named %s on interface %s", name, interface);
return FALSE;
}
--
1.7.7.6



2012-05-22 12:52:30

by Lucas De Marchi

[permalink] [raw]
Subject: Re: [PATCH BlueZ v0] gdbus: Fix incorrectly discarded signals

On Tue, May 22, 2012 at 9:28 AM, Luiz Augusto von Dentz
<[email protected]> wrote:
> Hi Mikel, Lucas,
>
> On Tue, May 22, 2012 at 3:21 PM, Lucas De Marchi
> <[email protected]> wrote:
>>> diff --git a/gdbus/object.c b/gdbus/object.c
>>> index 2dd7c0e..c33df57 100644
>>> --- a/gdbus/object.c
>>> +++ b/gdbus/object.c
>>> @@ -616,7 +616,7 @@ static gboolean check_signal(DBusConnection *conn, const char *path,
>>> ? ? ? ? ? ? ? ?}
>>> ? ? ? ?}
>>>
>>> - ? ? ? if (*args == NULL) {
>>> + ? ? ? if (!signal || !signal->name) {
>>> ? ? ? ? ? ? ? ?error("No signal named %s on interface %s", name, interface);
>>> ? ? ? ? ? ? ? ?return FALSE;
>>> ? ? ? ?}
>>
>>
>> Ack.
>>
>
> Any reason why the code does not return TRUE within the for loop? I
> think it would have been simpler that way.

Indeed, it would be much better. Mikel, could you change this?

Thanks
Lucas De Marchi

2012-05-22 12:28:40

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [PATCH BlueZ v0] gdbus: Fix incorrectly discarded signals

Hi Mikel, Lucas,

On Tue, May 22, 2012 at 3:21 PM, Lucas De Marchi
<[email protected]> wrote:
>> diff --git a/gdbus/object.c b/gdbus/object.c
>> index 2dd7c0e..c33df57 100644
>> --- a/gdbus/object.c
>> +++ b/gdbus/object.c
>> @@ -616,7 +616,7 @@ static gboolean check_signal(DBusConnection *conn, const char *path,
>> ? ? ? ? ? ? ? ?}
>> ? ? ? ?}
>>
>> - ? ? ? if (*args == NULL) {
>> + ? ? ? if (!signal || !signal->name) {
>> ? ? ? ? ? ? ? ?error("No signal named %s on interface %s", name, interface);
>> ? ? ? ? ? ? ? ?return FALSE;
>> ? ? ? ?}
>
>
> Ack.
>

Any reason why the code does not return TRUE within the for loop? I
think it would have been simpler that way.


--
Luiz Augusto von Dentz

2012-05-22 12:21:55

by Lucas De Marchi

[permalink] [raw]
Subject: Re: [PATCH BlueZ v0] gdbus: Fix incorrectly discarded signals

Hi Mikel,

On Tue, May 22, 2012 at 9:12 AM, Mikel Astiz <[email protected]> wrote:
> From: Mikel Astiz <[email protected]>
>
> Signals with no arguments were incorrectly filtered out due to the NULL
> inequality check.
> ---
> ?gdbus/object.c | ? ?2 +-
> ?1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/gdbus/object.c b/gdbus/object.c
> index 2dd7c0e..c33df57 100644
> --- a/gdbus/object.c
> +++ b/gdbus/object.c
> @@ -616,7 +616,7 @@ static gboolean check_signal(DBusConnection *conn, const char *path,
> ? ? ? ? ? ? ? ?}
> ? ? ? ?}
>
> - ? ? ? if (*args == NULL) {
> + ? ? ? if (!signal || !signal->name) {
> ? ? ? ? ? ? ? ?error("No signal named %s on interface %s", name, interface);
> ? ? ? ? ? ? ? ?return FALSE;
> ? ? ? ?}


Ack.

Thanks
Lucas De Marchi