]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
unqiueid: correct max uniqueid length test
authorScott Griepentrog <sgriepentrog@digium.com>
Mon, 10 Mar 2014 16:32:13 +0000 (16:32 +0000)
committerScott Griepentrog <sgriepentrog@digium.com>
Mon, 10 Mar 2014 16:32:13 +0000 (16:32 +0000)
This patch adds null string test prior to checking for
a max uniqueid value that was added in r410157.

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

main/manager.c
res/ari/resource_channels.c

index b64b362192a0e07790ac1142b4da398a0c592f42..f6027abb275d3a3883e2e4d5a685163f888d395d 100644 (file)
@@ -4728,8 +4728,8 @@ static int action_originate(struct mansession *s, const struct message *m)
        pthread_t th;
        int bridge_early = 0;
 
-       if (strlen(assignedids.uniqueid) >= AST_MAX_UNIQUEID ||
-               strlen(assignedids.uniqueid2) >= AST_MAX_UNIQUEID) {
+       if ((!ast_strlen_zero(assignedids.uniqueid) && strlen(assignedids.uniqueid) >= AST_MAX_UNIQUEID) ||
+               (!ast_strlen_zero(assignedids.uniqueid2) && strlen(assignedids.uniqueid2) >= AST_MAX_UNIQUEID)) {
                ast_log(LOG_WARNING, "Uniqueid length exceeds maximum of %d\n", AST_MAX_UNIQUEID);
        }
 
index 37595006ddedc520f3b39657ac996ccc4b846eed..0f4486b52ba71f252baebed90d9037411e514e75 100644 (file)
@@ -779,7 +779,7 @@ static void ari_channels_handle_originate_with_id(const char *args_endpoint,
        struct ast_assigned_ids assignedids = {args_channel_id, args_other_channel_id};
 
        if ((!ast_strlen_zero(assignedids.uniqueid) && strlen(assignedids.uniqueid) >= AST_MAX_UNIQUEID) || 
-               (!ast_strlen_zero(assignedids.uniqueid) && strlen(assignedids.uniqueid2) >= AST_MAX_UNIQUEID)) {
+               (!ast_strlen_zero(assignedids.uniqueid2) && strlen(assignedids.uniqueid2) >= AST_MAX_UNIQUEID)) {
                ast_log(LOG_WARNING, "Uniqueid length exceeds maximum of %d\n", AST_MAX_UNIQUEID);
        }