Package: asterisk / 1:1.6.2.9-2+squeeze12

parser-mangles-include Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Subject: Change the way that we read include files, to accommodate for changes in GCC 4.4 
Acked-by: Faidon Liambotis <paravoid@debian.org>
Bug: http://issues.asterisk.org/view.php?id=17472
Applied-Upstream: 1.6.2.11
Last-Update: 2010-09-07

--- a/main/config.c
+++ b/main/config.c
@@ -1023,12 +1023,13 @@
 		if (*c) {
 			*c = '\0';
 			/* Find real argument */
-			c = ast_skip_blanks(c + 1);
+			c = ast_strip(c + 1);
 			if (!(*c)) {
 				c = NULL;
 			}
-		} else 
+		} else {
 			c = NULL;
+		}
 		if (!strcasecmp(cur, "include")) {
 			do_include = 1;
 		} else if (!strcasecmp(cur, "exec")) {
@@ -1052,20 +1053,12 @@
 
 		cur = c;
 		/* Strip off leading and trailing "'s and <>'s */
-		if (*c == '"') {
-			/* Dequote */
-			while (*c) {
-				if (*c == '"') {
-					strcpy(c, c + 1); /* SAFE */
-					c--;
-				} else if (*c == '\\') {
-					strcpy(c, c + 1); /* SAFE */
-				}
-				c++;
-			}
-		} else if (*c == '<') {
-			/* C-style include */
-			if (*(c + strlen(c) - 1) == '>') {
+               if ((*c == '"') || (*c == '<')) {
+                       char quote_char = *c;
+                       if (quote_char == '<')
+                               quote_char = '>';
+
+                       if (*(c + strlen(c) - 1) == quote_char) {
 				cur++;
 				*(c + strlen(c) - 1) = '\0';
 			}