taint check MODW00T-00

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11339 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2009-01-21 21:34:31 +00:00
parent eee55db162
commit 1d5dd03f14
7 changed files with 58 additions and 40 deletions
+26 -1
View File
@@ -280,7 +280,32 @@ switch_mutex_unlock(obj->flag_mutex);
#define switch_set_string(_dst, _src) switch_copy_string(_dst, _src, sizeof(_dst))
static inline char *switch_clean_string(char *s)
static inline switch_bool_t switch_string_var_check(char *s, switch_bool_t disable)
{
char *p;
char *dol = NULL;
for (p = s; p && *p; p++) {
if (*p == '$') {
dol = p;
} else if (dol) {
if (*p == '{') {
if (disable) {
*dol = '%';
dol = NULL;
} else {
return SWITCH_TRUE;
}
} else if (*p != '\\') {
dol = NULL;
}
}
}
return SWITCH_FALSE;
}
static inline char *switch_clean_string(char *s)
{
char *p;
for (p = s; p && *p; p++) {