IntPatch:编译时自动修复整数溢出到缓冲区溢出漏洞
引言
整数溢出到缓冲区溢出(IO2BO)漏洞是一种被低估的威胁。当程序进行计算以确定要分配多少内存时发生整数溢出,导致分配的内存比预期少,从而引发缓冲区溢出。
例如,旧版本的Faad2中存在一个典型的IO2BO漏洞,代码片段如下:
458. static int32_t mp4ff_read_ctts(mp4ff_t *f)
459. {
460. // sth. omitted ...
467. track->ctts_entry_count = mp4ff_read_int32(f);
468.
469. track->ctts_sample_count = (int32_t*)malloc(sizeof(int32_t));
470. track->ctts_sample_offset = (int32_t*)malloc(track->ctts_entry_count * sizeof(int32_t));
481. for (i = 0; i < track->ctts_entry_count; i++)
482. {
483. track->ctts_sample_count[i] = mp4ff_read_int32(f);
484. track->ctts_sample_offset[i] = mp4ff_read_int32(f);
485. }
486. return 1;
488. }
在这个代码中,第467行从外部文件f读取一个
超级会员免费看
订阅专栏 解锁全文
1488

被折叠的 条评论
为什么被折叠?



