summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);