Skip to content

Commit

Permalink
first iter
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Jul 9, 2024
1 parent ca20156 commit 5072ae1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions libr/bin/format/objc/mach0_classes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1859,16 +1859,18 @@ RList *MACH0_(parse_classes)(RBinFile *bf, objc_cache_opt_info *oi) {
}
p = r_read_ble (&pp[0], bigendian, 8 * sizeof (mach0_ut));
MACH0_(get_class_t) (bf, klass, p, false, relocs, oi);
if (!klass->name) {
if (klass->name) {
const char *klass_name = r_bin_name_tostring (klass->name);
if (strlen (klass_name) > 512) {
R_LOG_INFO ("Invalid class name, probably corrupted binary");
break;
}
} else {
char *klass_name = r_str_newf ("UnnamedClass%" PFMT64d, num_of_unnamed_class);
klass->name = r_bin_name_new (klass_name);
free (klass_name);
num_of_unnamed_class++;
}
if (strlen (klass->name) > 512) {
R_LOG_INFO ("Invalid class name, probably corrupted binary");
break;
}
r_list_append (ret, klass);
}
metadata_sections_fini (&ms);
Expand Down

0 comments on commit 5072ae1

Please sign in to comment.