Yea, you are entirely right. Seems his actual diff had been done to 
initialize char *s = NULL, however that initialization was already 
committed in a previous patch so this patch is essentially useless.

Cheers,
dh

On 06/07/2016 11:50 AM, David Seikel wrote:
> Also, the message is not accurate.  Uninitialized pointers are not
> NULL, they are random garbage.  Setting a pointer to NULL is an
> initialization.  So it's either one or the other, and it's NULL you are
> checking for.
>
> On the other hand, if the real bug is an actual uninitialized pointer,
> the random garbage is not very likely to be what you are testing for.
>
> On Tue, 7 Jun 2016 16:13:14 +0200 "Jean Guyomarc'h"
> <jean.guyoma...@gmail.com> wrote:
>
>> uhhh?  what does this fix? the C standard specifies that free() does
>> nothing when its input is NULL (C11 ยง7.22.3.3).
>> Checking for NULL just adds an overhead here.
>>
>> Best regards,
>> Jean
>>
>> On Tue, Jun 7, 2016 at 3:43 PM, Benjamin Jacobs <b...@spam.thsi.be>
>> wrote:
>>> devilhorns pushed a commit to branch master.
>>>
>>> http://git.enlightenment.org/core/efl.git/commit/?id=ad2e21b02399c02a748bb8b8ab0dc10f85e6662d
>>>
>>> commit ad2e21b02399c02a748bb8b8ab0dc10f85e6662d
>>> Author: Benjamin Jacobs <b...@spam.thsi.be>
>>> Date:   Tue Jun 7 09:42:49 2016 -0400
>>>
>>>     elput: Missing pointer initialization.
>>>
>>>     Summary:
>>>     Calling free() on an uninitialized pointer leads to crash, that
>>> can occurs when sd_session_get_seat fails.
>>>     Fixes T3785.
>>>
>>>     Reviewers: devilhorns
>>>
>>>     Subscribers: cedric, jpeg
>>>
>>>     Maniphest Tasks: T3785
>>>
>>>     Differential Revision: https://phab.enlightenment.org/D4015
>>>
>>>     @fix
>>> ---
>>>  src/lib/elput/elput_logind.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/src/lib/elput/elput_logind.c
>>> b/src/lib/elput/elput_logind.c index 22cb1b0..799a26a 100644
>>> --- a/src/lib/elput/elput_logind.c
>>> +++ b/src/lib/elput/elput_logind.c
>>> @@ -427,7 +427,7 @@ _logind_connect(Elput_Manager **manager, const
>>> char *seat, unsigned int tty) if (ret < 0)
>>>       {
>>>          ERR("Failed to get session seat");
>>> -        free(s);
>>> +        if (s) free(s);
>>>          goto seat_err;
>>>       }
>>>     else if ((seat) && (s) && (strcmp(seat, s)))
>>>
>>> --
>>>
>>>
>>



------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to