Skip to content

Commit

Permalink
Fix oobread in java parser ##crash
Browse files Browse the repository at this point in the history
* Reported by @bet4it via @huntrdev
* BountyID c8f4c2de-7d96-4ad4-857a-c099effca2d6
* Reproducer: bootstrap.class
  • Loading branch information
radare authored and trufae committed Apr 24, 2022
1 parent 0927ed3 commit ecc44b6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions shlr/java/class.c
Expand Up @@ -6933,6 +6933,10 @@ R_API RBinJavaAttrInfo *r_bin_java_bootstrap_methods_attr_new(RBinJavaObj *bin,
offset += 6;
if (attr) {
attr->type = R_BIN_JAVA_ATTR_TYPE_BOOTSTRAP_METHODS_ATTR;
if (offset + 8 > sz) {
free (attr);
return NULL;
}
attr->info.bootstrap_methods_attr.num_bootstrap_methods = R_BIN_JAVA_USHORT (buffer, offset);
offset += 2;
attr->info.bootstrap_methods_attr.bootstrap_methods = r_list_newf (r_bin_java_bootstrap_method_free);
Expand Down

0 comments on commit ecc44b6

Please sign in to comment.