pjsip/dialplan_functions: Use the right buffer length when printing URIs
authorMatthew Jordan <mjordan@digium.com>
Sun, 15 Dec 2013 01:39:20 +0000 (01:39 +0000)
committerMatthew Jordan <mjordan@digium.com>
Sun, 15 Dec 2013 01:39:20 +0000 (01:39 +0000)
While entertaining, sizeof(buflen) is not the same as buflen. Doh.
........

Merged revisions 403823 from http://svn.asterisk.org/svn/asterisk/branches/12

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

channels/pjsip/dialplan_functions.c

index ac98be5..817af00 100644 (file)
@@ -582,15 +582,15 @@ static int channel_read_pjsip(struct ast_channel *chan, const char *type, const
        if (!strcmp(type, "secure")) {
                snprintf(buf, buflen, "%u", dlg->secure ? 1 : 0);
        } else if (!strcmp(type, "target_uri")) {
        if (!strcmp(type, "secure")) {
                snprintf(buf, buflen, "%u", dlg->secure ? 1 : 0);
        } else if (!strcmp(type, "target_uri")) {
-               pjsip_uri_print(PJSIP_URI_IN_REQ_URI, dlg->target, buf, sizeof(buflen));
+               pjsip_uri_print(PJSIP_URI_IN_REQ_URI, dlg->target, buf, buflen);
                buf_copy = ast_strdupa(buf);
                ast_escape_quoted(buf_copy, buf, buflen);
        } else if (!strcmp(type, "local_uri")) {
                buf_copy = ast_strdupa(buf);
                ast_escape_quoted(buf_copy, buf, buflen);
        } else if (!strcmp(type, "local_uri")) {
-               pjsip_uri_print(PJSIP_URI_IN_FROMTO_HDR, dlg->local.info->uri, buf, sizeof(buflen));
+               pjsip_uri_print(PJSIP_URI_IN_FROMTO_HDR, dlg->local.info->uri, buf, buflen);
                buf_copy = ast_strdupa(buf);
                ast_escape_quoted(buf_copy, buf, buflen);
        } else if (!strcmp(type, "remote_uri")) {
                buf_copy = ast_strdupa(buf);
                ast_escape_quoted(buf_copy, buf, buflen);
        } else if (!strcmp(type, "remote_uri")) {
-               pjsip_uri_print(PJSIP_URI_IN_FROMTO_HDR, dlg->remote.info->uri, buf, sizeof(buflen));
+               pjsip_uri_print(PJSIP_URI_IN_FROMTO_HDR, dlg->remote.info->uri, buf, buflen);
                buf_copy = ast_strdupa(buf);
                ast_escape_quoted(buf_copy, buf, buflen);
        } else if (!strcmp(type, "t38state")) {
                buf_copy = ast_strdupa(buf);
                ast_escape_quoted(buf_copy, buf, buflen);
        } else if (!strcmp(type, "t38state")) {