提交 85d6f7d8 编写于 作者: K ksrini

6830335: Java JAR Pack200 Decompression Integer Overflow Vulnerability

Summary: Fixes a potential vulnerability in the unpack200 logic, by adding extra checks, a back-port.
Reviewed-by: asaha
上级 2ba224d3
......@@ -908,10 +908,12 @@ void cpool::init(unpacker* u_, int counts[NUM_COUNTS]) {
// place a limit on future CP growth:
int generous = 0;
generous += u->ic_count*3; // implicit name, outer, outer.utf8
generous += 40; // WKUs, misc
generous += u->class_count; // implicit SourceFile strings
maxentries = nentries + generous;
generous = add_size(generous, u->ic_count); // implicit name
generous = add_size(generous, u->ic_count); // outer
generous = add_size(generous, u->ic_count); // outer.utf8
generous = add_size(generous, 40); // WKUs, misc
generous = add_size(generous, u->class_count); // implicit SourceFile strings
maxentries = add_size(nentries, generous);
// Note that this CP does not include "empty" entries
// for longs and doubles. Those are introduced when
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册