summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2011-09-07 13:15:49 +0200
committerStephen Gallagher <sgallagh@redhat.com>2011-09-07 16:04:10 -0400
commitd09285e101d731771d9d4beeb1386cdad670fb88 (patch)
treef365633c30e977e2cf024ad0d166625f5c0d07fc
parent5fd1c0557734da0649d91d87d6fcdc56c1a95f91 (diff)
downloadsssd-d09285e101d731771d9d4beeb1386cdad670fb88.tar.gz
sssd-d09285e101d731771d9d4beeb1386cdad670fb88.tar.xz
sssd-d09285e101d731771d9d4beeb1386cdad670fb88.zip
Do not access memory out of bounds
-rw-r--r--src/providers/ipa/ipa_hbac_hosts.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/providers/ipa/ipa_hbac_hosts.c b/src/providers/ipa/ipa_hbac_hosts.c
index dd82f2848..4aea8608f 100644
--- a/src/providers/ipa/ipa_hbac_hosts.c
+++ b/src/providers/ipa/ipa_hbac_hosts.c
@@ -499,10 +499,10 @@ hbac_shost_attrs_to_rule(TALLOC_CTX *mem_ctx,
goto done;
}
- for (idx = host_count; idx <= host_count + el->num_values; idx++) {
+ 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;