return;
}
char *name_dup = strdup (name);
+ if (!name_dup) {
+ R_LOG_ERROR ("Failed to allocate(strdup) memory for storing access");
+ return;
+ }
TypeTraceAccess *access = VecAccess_emplace_back (&trace->db.accesses);
+ if (!access) {
+ free (name_dup);
+ R_LOG_ERROR ("Failed to allocate memory for storing access");
+ return;
+ }
access->is_reg = true;
access->reg.name = name_dup;
access->reg.value = val;
RBuffer *buf = bf->buf;
const ut8 *data = r_buf_data (buf, NULL);
size_t size = r_buf_size (buf);
+ // Check for integer overflow: dotnet_parse expects int, not size_t
+ if (size > INT_MAX) {
+ return NULL;
+ }
ut64 image_base = PE_(r_bin_pe_get_image_base)(pe);
RList *dotnet_symbols = dotnet_parse (data, size, image_base);
if (r_list_empty (dotnet_symbols)) {
if (key_len < sizeof (ApfsKeyHeader)) {
return false;
}
+ // Sanity check: val_len should not exceed block size
+ if (val_len > ctx->block_size) {
+ R_LOG_DEBUG ("apfs: val_len (%u) exceeds block_size (%u), skipping", val_len, ctx->block_size);
+ return false;
+ }
ApfsKeyHeader *key_hdr = (ApfsKeyHeader *)key_data;
ut64 obj_id_and_type = apfs_read64 (ctx, (ut8 *)&key_hdr->obj_id_and_type);