]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Don't report a syntax error when an empty string is passed to ast_get_group.
authorRussell Bryant <russell@russellbryant.com>
Thu, 27 Dec 2007 21:40:02 +0000 (21:40 +0000)
committerRussell Bryant <russell@russellbryant.com>
Thu, 27 Dec 2007 21:40:02 +0000 (21:40 +0000)
Just return 0.

(closes issue #11540)
Reported by: tzafrir
Patches:
      group_empty.diff uploaded by tzafrir (license 46)
   -- slightly changed by me

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@95024 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/channel.c

index c644dbe42dd9e058126096d11d1dbcf4840ed2c7..0ccf18b75f1c3ecec2f8eea16444596720d91cf6 100644 (file)
@@ -4596,6 +4596,9 @@ ast_group_t ast_get_group(const char *s)
        int start=0, finish=0, x;
        ast_group_t group = 0;
 
+       if (ast_strlen_zero(s))
+               return 0;
+
        c = ast_strdupa(s);
        
        while ((piece = strsep(&c, ","))) {