mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-25 06:00:36 +00:00
When ast_strip_quoted was called with a zero-length string, it would treat a
NULL as if it were the quoting character (and would thus return the string in memory immediately following the passed-in string). git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@51194 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
2
utils.c
2
utils.c
@@ -520,7 +520,7 @@ char *ast_strip_quoted(char *s, const char *beg_quotes, const char *end_quotes)
|
||||
char *q;
|
||||
|
||||
s = ast_strip(s);
|
||||
if ((q = strchr(beg_quotes, *s))) {
|
||||
if ((q = strchr(beg_quotes, *s)) && *q != '\0') {
|
||||
e = s + strlen(s) - 1;
|
||||
if (*e == *(end_quotes + (q - beg_quotes))) {
|
||||
s++;
|
||||
|
||||
Reference in New Issue
Block a user