]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
When ast_strip_quoted was called with a zero-length string, it would treat a
authorTilghman Lesher <tilghman@meg.abyt.es>
Wed, 17 Jan 2007 20:52:21 +0000 (20:52 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Wed, 17 Jan 2007 20:52:21 +0000 (20:52 +0000)
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

utils.c

diff --git a/utils.c b/utils.c
index e712ebe665cc9f30d44b02237951c0dea82546aa..6b3680b8fa29bb5254af16d7df5b0537e4cdb644 100644 (file)
--- a/utils.c
+++ b/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++;