[SSSD] [PATCH] Do not access memory out of bounds

Sumit Bose sbose at redhat.com
Wed Sep 7 11:30:54 UTC 2011


Hi,

while testing HBAC Shanks found an issue (bz736314) while processing
external hosts. This patch should fix it.

bye,
Sumit
-------------- next part --------------
From df7f08d7df67d47c08a43003228e7b472a9cd65e Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose at redhat.com>
Date: Wed, 7 Sep 2011 13:15:49 +0200
Subject: [PATCH] Do not access memory out of bounds

---
 src/providers/ipa/ipa_hbac_hosts.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/providers/ipa/ipa_hbac_hosts.c b/src/providers/ipa/ipa_hbac_hosts.c
index 70be90e..5e6a25f 100644
--- a/src/providers/ipa/ipa_hbac_hosts.c
+++ b/src/providers/ipa/ipa_hbac_hosts.c
@@ -502,7 +502,7 @@ hbac_shost_attrs_to_rule(TALLOC_CTX *mem_ctx,
         for (idx = host_count; idx <= host_count + el->num_values; idx++) {
             shosts->names[idx] =
                     talloc_strdup(shosts->names,
-                                  (const char *)el->values[idx].data);
+                               (const char *)el->values[idx - host_count].data);
             if (shosts->names[idx] == NULL) {
                 ret = ENOMEM;
                 goto done;
-- 
1.7.6



More information about the sssd-devel mailing list