Skip to content
Snippets Groups Projects
Commit 0a88b25c authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #27201: libiax: fix out of bounds memory access

parent afa65a06
No related branches found
No related tags found
No related merge requests found
......@@ -369,7 +369,7 @@ void iax_showframe(struct iax_frame *f, struct ast_iax2_full_hdr *fhi, int rx, s
/* Don't mess with mini-frames */
return;
}
if (fh->type > (int)sizeof(frames)/(int)sizeof(char *)) {
if (fh->type >= (int)sizeof(frames)/(int)sizeof(char *)) {
snprintf(class2, (int)sizeof(class2), "(%d?)", fh->type);
clas = class2;
} else {
......@@ -386,7 +386,7 @@ void iax_showframe(struct iax_frame *f, struct ast_iax2_full_hdr *fhi, int rx, s
subclass = iaxs[(int)fh->csub];
}
} else if (fh->type == AST_FRAME_CONTROL) {
if (fh->csub > (int)sizeof(cmds)/(int)sizeof(char *)) {
if (fh->csub >= (int)sizeof(cmds)/(int)sizeof(char *)) {
snprintf(subclass2, (int)sizeof(subclass2), "(%d?)", fh->csub);
subclass = subclass2;
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment