Well, the content of a channel variable may be longer than the size of a pointer...
authorOlle Johansson <oej@edvina.net>
Wed, 23 Jul 2008 08:13:07 +0000 (08:13 +0000)
committerOlle Johansson <oej@edvina.net>
Wed, 23 Jul 2008 08:13:07 +0000 (08:13 +0000)
Thanks, eliel!

Reported by: eliel
Patches:
      chan_siptrunk.SIPPEER.patch uploaded by eliel (license 64)
(closes issue #13135)

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

channels/chan_sip.c

index fd3233d..d867de9 100644 (file)
@@ -14867,7 +14867,7 @@ static int function_sippeer(struct ast_channel *chan, const char *cmd, char *dat
                chanvar = strsep(&chanvar, "]");
                for (v = peer->chanvars ; v ; v = v->next)
                        if (strcasecmp(v->name, chanvar) == 0)
-                               ast_copy_string(buf, v->value, sizeof(buf));
+                               ast_copy_string(buf, v->value, len);
        } else  if (!strncasecmp(colname, "codec[", 6)) {
                char *codecnum;
                int index = 0, codec = 0;