diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2005-07-05 19:52:48 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2005-07-05 19:52:48 +0000 |
commit | 386f0e70b39f503a519654c5fceb84257d413ea1 (patch) | |
tree | b20fa9cc9c29351cf615b14ff22d4af969d26c76 /channel.c | |
parent | 7d841b18857fab6417f93ee252ffe72fef4a9e8d (diff) |
ensure that text frames are copied correctly even if they are not null-terminated (bug #4615)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6030 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channel.c')
-rwxr-xr-x | channel.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |