Blame SOURCES/sudo-1.8.6p3-emallocfail.patch
|
|
1b092f |
diff -up sudo-1.8.6p3/plugins/sudoers/sssd.c.emallocfail sudo-1.8.6p3/plugins/sudoers/sssd.c
|
|
|
1b092f |
--- sudo-1.8.6p3/plugins/sudoers/sssd.c.emallocfail 2012-11-23 15:58:20.139417659 +0100
|
|
|
1b092f |
+++ sudo-1.8.6p3/plugins/sudoers/sssd.c 2012-11-23 15:58:26.732437421 +0100
|
|
|
1b092f |
@@ -212,7 +212,12 @@ sudo_sss_filter_result(struct sudo_sss_h
|
|
|
1b092f |
sudo_debug_printf(SUDO_DEBUG_DEBUG,
|
|
|
1b092f |
"reallocating result: %p (count: %u -> %u)", out_res->rules,
|
|
|
1b092f |
in_res->num_rules, l);
|
|
|
1b092f |
- out_res->rules = erealloc3(out_res->rules, l, sizeof(struct sss_sudo_rule));
|
|
|
1b092f |
+ if (l > 0)
|
|
|
1b092f |
+ out_res->rules = erealloc3(out_res->rules, l, sizeof(struct sss_sudo_rule));
|
|
|
1b092f |
+ else {
|
|
|
1b092f |
+ efree(out_res->rules);
|
|
|
1b092f |
+ out_res->rules = NULL;
|
|
|
1b092f |
+ }
|
|
|
1b092f |
}
|
|
|
1b092f |
|
|
|
1b092f |
out_res->num_rules = l;
|