[SSSD] [PATCH] Fix segfault in AD Subdomains Module
Lukas Slebodnik
lslebodn at redhat.com
Wed May 15 09:34:19 UTC 2013
On (15/05/13 11:19), Jakub Hrozek wrote:
>On Wed, May 15, 2013 at 10:17:02AM +0200, Lukas Slebodnik wrote:
>> ehlo,
>>
>> In function ad_subdomains_get_netlogon_done:
>> If variable "reply_count" is zero then variable "reply" will not be
>> initialized. Therefore we should not continue.
>>
>> I am not sure about return code.
>>
>> Patch is attached.
>>
>> LS
>
>> From b15e1a6b664201493ec0288a9c8e4ec5b2983dbc Mon Sep 17 00:00:00 2001
>> From: Lukas Slebodnik <lslebodn at redhat.com>
>> Date: Wed, 15 May 2013 10:09:08 +0200
>> Subject: [PATCH] Fix segfault in AD Subdomains Module
>>
>> In function ad_subdomains_get_netlogon_done:
>> If variable "reply_count" is zero then variable "reply" will not be
>> initialized. Therefore we should not continue.
>> ---
>> src/providers/ad/ad_subdomains.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/src/providers/ad/ad_subdomains.c b/src/providers/ad/ad_subdomains.c
>> index 1da343f8711b2b99a7afff6a4a398a1aa515a875..826ec9304ba7974bd857c02203026d9551699fc7 100644
>> --- a/src/providers/ad/ad_subdomains.c
>> +++ b/src/providers/ad/ad_subdomains.c
>> @@ -307,6 +307,8 @@ static void ad_subdomains_get_netlogon_done(struct tevent_req *req)
>>
>> if (reply_count == 0) {
>> DEBUG(SSSDBG_TRACE_FUNC, ("No netlogon data available.\n"));
>> + ret = EINVAL;
>
>Nice catch, but wouldn't ENOENT be a better error code here?
>
>> + goto done;
>> } else if (reply_count > 1) {
>> DEBUG(SSSDBG_OP_FAILURE,
>> ("More than one netlogon info returned.\n"));
>> --
>> 1.8.1.4
>>
New patch attached.
LS
-------------- next part --------------
>From b67126cd07f44ca60e4964d1749e880d3131989a Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Wed, 15 May 2013 10:09:08 +0200
Subject: [PATCH] Fix segfault in AD Subdomains Module
In function ad_subdomains_get_netlogon_done:
If variable "reply_count" is zero then variable "reply" will not be
initialized. Therefore we should not continue.
---
src/providers/ad/ad_subdomains.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/providers/ad/ad_subdomains.c b/src/providers/ad/ad_subdomains.c
index 1da343f8711b2b99a7afff6a4a398a1aa515a875..2ad318f63a89b2e8894ca07d007cde11867ed290 100644
--- a/src/providers/ad/ad_subdomains.c
+++ b/src/providers/ad/ad_subdomains.c
@@ -307,6 +307,8 @@ static void ad_subdomains_get_netlogon_done(struct tevent_req *req)
if (reply_count == 0) {
DEBUG(SSSDBG_TRACE_FUNC, ("No netlogon data available.\n"));
+ ret = ENOENT;
+ goto done;
} else if (reply_count > 1) {
DEBUG(SSSDBG_OP_FAILURE,
("More than one netlogon info returned.\n"));
--
1.8.1.4
More information about the sssd-devel
mailing list