[SSSD] [PATCH] IPA: Fix error handling after talloc_ber_flatten

Lukas Slebodnik lslebodn at redhat.com
Sat Oct 11 21:48:14 UTC 2014


ehlo,

The function talloc_ber_flatten can return EFAULT, ENOMEM, EOK.
But it was tested for -1.

simple patch is attached.

LS
-------------- next part --------------
>From 2ae945a8836f32bad0edb44ff60002c810acfc33 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Sat, 11 Oct 2014 11:09:49 +0200
Subject: [PATCH 6/9] IPA: Fix error handling after talloc_ber_flatten

The function talloc_ber_flatten can return EFAULT, ENOMEM, EOK.
But it was tested for -1.
---
 src/providers/ipa/ipa_s2n_exop.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/providers/ipa/ipa_s2n_exop.c b/src/providers/ipa/ipa_s2n_exop.c
index 76494a031904c39134de81cc141d333b73dca401..148778918c8bb2551ae79708cc53984bd982f314 100644
--- a/src/providers/ipa/ipa_s2n_exop.c
+++ b/src/providers/ipa/ipa_s2n_exop.c
@@ -359,8 +359,7 @@ static errno_t s2n_encode_request(TALLOC_CTX *mem_ctx,
     }
 
     ret = talloc_ber_flatten(mem_ctx, ber, _bv);
-    if (ret == -1) {
-        ret = EFAULT;
+    if (ret != EOK) {
         goto done;
     }
 
-- 
2.1.0



More information about the sssd-devel mailing list