Skip to content
Snippets Groups Projects
Commit 1db9dc0c authored by Joshua Colp's avatar Joshua Colp
Browse files

Merged revisions 57798 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r57798 | file | 2007-03-04 23:19:53 -0500 (Sun, 04 Mar 2007) | 2 lines

Don't allow a NULL pointer to reach ast_frdup. (issue #9155 reported by cmaj)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@57799 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 1dd8e4b0
No related branches found
No related tags found
No related merge requests found
......@@ -56,7 +56,7 @@ void ast_slinfactory_destroy(struct ast_slinfactory *sf)
int ast_slinfactory_feed(struct ast_slinfactory *sf, struct ast_frame *f)
{
struct ast_frame *frame, *frame_ptr;
struct ast_frame *begin_frame = f, *duped_frame = NULL, *frame_ptr;
unsigned int x;
if (f->subclass != AST_FORMAT_SLINEAR) {
......@@ -74,16 +74,16 @@ int ast_slinfactory_feed(struct ast_slinfactory *sf, struct ast_frame *f)
}
}
if (!(frame = ast_frdup( (sf->trans) ? ast_translate(sf->trans, f, 0) : f )))
if ((sf->trans && (!(begin_frame = ast_translate(sf->trans, f, 0)))) || (!(duped_frame = ast_frdup(begin_frame))))
return 0;
x = 0;
AST_LIST_TRAVERSE(&sf->queue, frame_ptr, frame_list)
x++;
AST_LIST_INSERT_TAIL(&sf->queue, frame, frame_list);
AST_LIST_INSERT_TAIL(&sf->queue, duped_frame, frame_list);
sf->size += frame->samples;
sf->size += duped_frame->samples;
return x;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment