aboutsummaryrefslogtreecommitdiffstats
path: root/channel.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-07-05 19:52:48 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-07-05 19:52:48 +0000
commitd38807784af142b6b014bb40084d5c06505fd497 (patch)
treeb20fa9cc9c29351cf615b14ff22d4af969d26c76 /channel.c
parent7104dd0bc94b6b1aa4b06686f7e51be2af82fca1 (diff)
ensure that text frames are copied correctly even if they are not null-terminated (bug #4615)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6030 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channel.c')
-rwxr-xr-xchannel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/channel.c b/channel.c
index 25162c5b8..5fa5d3697 100755
--- a/channel.c
+++ b/channel.c
@@ -1716,7 +1716,7 @@ char *ast_recvtext(struct ast_channel *chan, int timeout)
if (f->frametype == AST_FRAME_CONTROL && f->subclass == AST_CONTROL_HANGUP)
done = 1; /* force a break */
else if (f->frametype == AST_FRAME_TEXT) { /* what we want */
- buf = strdup((char *)f->data); /* dup and break */
+ buf = strndup((char *)f->data, f->datalen); /* dup and break */
done = 1;
}
ast_frfree(f);