]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fixx off-by-one in xml preprocessor
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 19 May 2009 15:38:45 +0000 (15:38 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 19 May 2009 15:38:45 +0000 (15:38 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13385 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_xml.c

index bbb45277c8ca81029e203af9f655fccf6b60c629..3cc34c961a0e00ee9c8aecfa04c20691b20f5530 100644 (file)
@@ -1147,7 +1147,7 @@ static char *expand_vars(char *buf, char *ebuf, switch_size_t elen, switch_size_
        while (*rp && wp < ep) {
 
                if (*rp == '$' && *(rp + 1) == '$' && *(rp + 2) == '{') {
-                       char *e = strchr(rp, '}');
+                       char *e = switch_find_end_paren(rp + 2, '{', '}');
 
                        if (e) {
                                rp += 3;
@@ -1160,6 +1160,7 @@ static char *expand_vars(char *buf, char *ebuf, switch_size_t elen, switch_size_
                                                *wp++ = *p;
                                        }
                                }
+                               continue;
                        }
                }