
- add latest improvements, up to patch 35 git-svn-id: svn://svn.openwrt.org/openwrt/packages@36096 3c298f89-4303-0410-b956-a3cf2f4a3e73
33 lines
1.1 KiB
Diff
33 lines
1.1 KiB
Diff
From 48ffce4546ce99d51ea8c3dfb575c307e9f96ea5 Mon Sep 17 00:00:00 2001
|
|
From: Willy Tarreau <w@1wt.eu>
|
|
Date: Thu, 24 Jan 2013 00:25:39 +0100
|
|
Subject: BUG/MINOR: config: fix improper check for failed memory alloc in ACL parser
|
|
|
|
The wrong variable is checked after a calloc() so a memory shortage would
|
|
result in a segfault while loading the config instead of a clean error.
|
|
|
|
This fix may be backported to 1.4 and 1.3 which are both affected.
|
|
|
|
Reported-by: Dinko Korunic <dkorunic@reflected.net>
|
|
(cherry picked from commit f678b7f32253fa7b279f907dbda563e985c6478c)
|
|
---
|
|
src/acl.c | 2 +-
|
|
1 files changed, 1 insertions(+), 1 deletions(-)
|
|
|
|
diff --git a/src/acl.c b/src/acl.c
|
|
index 35b6eb8..793e5ca 100644
|
|
--- a/src/acl.c
|
|
+++ b/src/acl.c
|
|
@@ -1230,7 +1230,7 @@ struct acl_cond *parse_acl_cond(const char **args, struct list *known_acl, int p
|
|
|
|
if (!cur_suite) {
|
|
cur_suite = (struct acl_term_suite *)calloc(1, sizeof(*cur_suite));
|
|
- if (cur_term == NULL)
|
|
+ if (cur_suite == NULL)
|
|
goto out_free_term;
|
|
LIST_INIT(&cur_suite->terms);
|
|
LIST_ADDQ(&cond->suites, &cur_suite->list);
|
|
--
|
|
1.7.1
|
|
|