Skip to content

Commit ecc44b6

Browse files
radaretrufae
authored andcommitted
Fix oobread in java parser ##crash
* Reported by @bet4it via @huntrdev * BountyID c8f4c2de-7d96-4ad4-857a-c099effca2d6 * Reproducer: bootstrap.class
1 parent 0927ed3 commit ecc44b6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: shlr/java/class.c

+4
Original file line numberDiff line numberDiff line change
@@ -6933,6 +6933,10 @@ R_API RBinJavaAttrInfo *r_bin_java_bootstrap_methods_attr_new(RBinJavaObj *bin,
69336933
offset += 6;
69346934
if (attr) {
69356935
attr->type = R_BIN_JAVA_ATTR_TYPE_BOOTSTRAP_METHODS_ATTR;
6936+
if (offset + 8 > sz) {
6937+
free (attr);
6938+
return NULL;
6939+
}
69366940
attr->info.bootstrap_methods_attr.num_bootstrap_methods = R_BIN_JAVA_USHORT (buffer, offset);
69376941
offset += 2;
69386942
attr->info.bootstrap_methods_attr.bootstrap_methods = r_list_newf (r_bin_java_bootstrap_method_free);

0 commit comments

Comments
 (0)