Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
ztravis committed Aug 16, 2024
1 parent 2200396 commit 89563b0
Showing 1 changed file with 28 additions and 35 deletions.
63 changes: 28 additions & 35 deletions libpff/libpff_name_to_id_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,41 +365,34 @@ int libpff_name_to_id_map_read(

goto on_error;
}
if( name_to_id_map_entries_data == NULL )
{
libcerror_error_set(
error,
LIBCERROR_ERROR_DOMAIN_RUNTIME,
LIBCERROR_RUNTIME_ERROR_VALUE_MISSING,
"%s: missing name to id map entries data.",
function );

goto on_error;
}
if( ( name_to_id_map_entries_data_size == 0 )
|| ( name_to_id_map_entries_data_size > (size_t) SSIZE_MAX ) )
{
libcerror_error_set(
error,
LIBCERROR_ERROR_DOMAIN_RUNTIME,
LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS,
"%s: invalid name to id map entries data size value out of bounds.",
function );

goto on_error;
}
if( ( name_to_id_map_entries_data_size % 8 ) != 0 )
{
libcerror_error_set(
error,
LIBCERROR_ERROR_DOMAIN_RUNTIME,
LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE,
"%s: unsupported name to id map entries size.",
function );

goto on_error;
}
number_of_name_to_id_map_entries = (uint32_t) ( name_to_id_map_entries_data_size / 8 );
if( name_to_id_map_entries_data == NULL || name_to_id_map_entries_data_size == 0)
{
number_of_name_to_id_map_entries = 0;
} else {
if(( name_to_id_map_entries_data_size > (size_t) SSIZE_MAX ) )
{
libcerror_error_set(
error,
LIBCERROR_ERROR_DOMAIN_RUNTIME,
LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS,
"%s: invalid name to id map entries data size value out of bounds.",
function );

goto on_error;
}
if( ( name_to_id_map_entries_data_size % 8 ) != 0 )
{
libcerror_error_set(
error,
LIBCERROR_ERROR_DOMAIN_RUNTIME,
LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE,
"%s: unsupported name to id map entries size.",
function );

goto on_error;
}
number_of_name_to_id_map_entries = (uint32_t) ( name_to_id_map_entries_data_size / 8 );
}

if( libpff_table_get_record_entry_by_type(
item_values->table,
Expand Down

0 comments on commit 89563b0

Please sign in to comment.