]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-6090 --resolve
authorRaymond Chandler <intralanman@gmail.com>
Wed, 15 Jan 2014 15:56:15 +0000 (10:56 -0500)
committerRaymond Chandler <intralanman@gmail.com>
Wed, 15 Jan 2014 15:56:22 +0000 (10:56 -0500)
src/mod/applications/mod_lcr/mod_lcr.c

index 7755eadb5a3fa1a46959ae1e9bddc4a25a88739b..c5e6e26841a69733710e982d93aabb5e6b8fb8f5 100644 (file)
@@ -191,9 +191,13 @@ static const char *do_cid(switch_memory_pool_t *pool, const char *cid, const cha
                src++;
                
                /* break on first / */
-               dst = strchr(src, '/');
-               *dst = '\0';
-               dst++;
+               if((dst = strchr(src, '/'))) {
+                       *dst = '\0';
+                       dst++;
+               } else {
+                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Invalid destination part in regexp: %s\n", src);
+                       goto done;
+               }
                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "src: %s, dst: %s\n", src, dst);
        } else {
                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Not a valid regexp: %s\n", src);