[systemd-devel] [PATCH 1/3] sd-bus: avoid potentially unrefing a unitialized sd_bus_slot

Thomas H.P. Andersen phomes at gmail.com
Fri May 16 23:47:38 PDT 2014


On Sat, May 17, 2014 at 12:07 AM, Zbigniew Jędrzejewski-Szmek
<zbyszek at in.waw.pl> wrote:
> On Fri, May 16, 2014 at 11:53:23PM +0200, Thomas H.P. Andersen wrote:
>> From: Thomas Hindoe Paaboel Andersen <phomes at gmail.com>
>>
>> ---
>>  src/libsystemd/sd-bus/bus-objects.c | 2 +-
>>  src/libsystemd/sd-bus/sd-bus.c      | 2 +-
>>  2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/libsystemd/sd-bus/bus-objects.c b/src/libsystemd/sd-bus/bus-objects.c
>> index 51d4a62..dbb04e5 100644
>> --- a/src/libsystemd/sd-bus/bus-objects.c
>> +++ b/src/libsystemd/sd-bus/bus-objects.c
>> @@ -1602,7 +1602,7 @@ static int add_object_vtable_internal(
>>                  sd_bus_object_find_t find,
>>                  void *userdata) {
>>
>> -        sd_bus_slot *s;
>> +        sd_bus_slot *s = NULL;
>>          struct node_vtable *i, *existing = NULL;
>>          const sd_bus_vtable *v;
>>          struct node *n;
>> diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c
>> index ec2843f..1f1a4d3 100644
>> --- a/src/libsystemd/sd-bus/sd-bus.c
>> +++ b/src/libsystemd/sd-bus/sd-bus.c
>> @@ -2821,7 +2821,7 @@ _public_ int sd_bus_add_match(
>>
>>          struct bus_match_component *components = NULL;
>>          unsigned n_components = 0;
>> -        sd_bus_slot *s;
>> +        sd_bus_slot *s = NULL;
>>          int r = 0;
>>
>>          assert_return(bus, -EINVAL);
> That makes it the third identical patch :)

Heh. At least we agree on the fix :)


More information about the systemd-devel mailing list