mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-18 18:58:22 +00:00
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
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user