From: Todd C. Miller Date: Fri, 17 Jul 2015 19:58:26 +0000 (-0600) Subject: Fix typo in sudo_sss_attrcpy() that caused a memory allocation error. X-Git-Tag: SUDO_1_8_14p1^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=db8607fe4e2b6559024b025f9e1186df3e7a95d1;p=sudo Fix typo in sudo_sss_attrcpy() that caused a memory allocation error. --- diff --git a/plugins/sudoers/sssd.c b/plugins/sudoers/sssd.c index 7da05b198..f297192e8 100644 --- a/plugins/sudoers/sssd.c +++ b/plugins/sudoers/sssd.c @@ -142,7 +142,7 @@ sudo_sss_attrcpy(struct sss_sudo_attr *dst, const struct sss_sudo_attr *src) sudo_debug_printf(SUDO_DEBUG_INFO, "malloc: cnt=%d", src->num_values); dst->name = strdup(src->name); - dst->values = reallocarray(NULL, dst->num_values, sizeof(char *)); + dst->values = reallocarray(NULL, src->num_values, sizeof(char *)); if (dst->name == NULL || dst->values == NULL) goto oom; dst->num_values = src->num_values; @@ -195,7 +195,6 @@ sudo_sss_rulecpy(struct sss_sudo_rule *dst, const struct sss_sudo_rule *src) for (i = 0; i < src->num_attrs; ++i) { if (!sudo_sss_attrcpy(dst->attrs + i, src->attrs + i)) { - sudo_warnx(U_("%s: %s"), __func__, U_("unable to allocate memory")); dst->num_attrs = i; sudo_sss_rulefree(dst); debug_return_bool(false);