libcdata_array_initialize:
   40|   348k|{
   41|   348k|	libcdata_internal_array_t *internal_array = NULL;
   42|   348k|	static char *function                     = "libcdata_array_initialize";
   43|   348k|	size_t entries_size                       = 0;
   44|   348k|	int number_of_allocated_entries           = 0;
   45|       |
   46|   348k|	if( array == NULL )
  ------------------
  |  Branch (46:6): [True: 0, False: 348k]
  ------------------
   47|      0|	{
   48|      0|		libcerror_error_set(
   49|      0|		 error,
   50|      0|		 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
   51|      0|		 LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE,
   52|      0|		 "%s: invalid array.",
   53|      0|		 function );
   54|       |
   55|      0|		return( -1 );
   56|      0|	}
   57|   348k|	if( *array != NULL )
  ------------------
  |  Branch (57:6): [True: 0, False: 348k]
  ------------------
   58|      0|	{
   59|      0|		libcerror_error_set(
   60|      0|		 error,
   61|      0|		 LIBCERROR_ERROR_DOMAIN_RUNTIME,
   62|      0|		 LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET,
   63|      0|		 "%s: invalid array value already set.",
   64|      0|		 function );
   65|       |
   66|      0|		return( -1 );
   67|      0|	}
   68|   348k|	if( number_of_entries < 0 )
  ------------------
  |  Branch (68:6): [True: 0, False: 348k]
  ------------------
   69|      0|	{
   70|      0|		libcerror_error_set(
   71|      0|		 error,
   72|      0|		 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
   73|      0|		 LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO,
   74|      0|		 "%s: invalid number of entries value less than zero.",
   75|      0|		 function );
   76|       |
   77|      0|		return( -1 );
   78|      0|	}
   79|   348k|	internal_array = memory_allocate_structure(
  ------------------
  |  |   64|   348k|	(type *) memory_allocate( sizeof( type ) )
  |  |  ------------------
  |  |  |  |   60|   348k|	malloc( size )
  |  |  ------------------
  ------------------
   80|   348k|	                  libcdata_internal_array_t );
   81|       |
   82|   348k|	if( internal_array == NULL )
  ------------------
  |  Branch (82:6): [True: 0, False: 348k]
  ------------------
   83|      0|	{
   84|      0|		libcerror_error_set(
   85|      0|		 error,
   86|      0|		 LIBCERROR_ERROR_DOMAIN_MEMORY,
   87|      0|		 LIBCERROR_MEMORY_ERROR_INSUFFICIENT,
   88|      0|		 "%s: unable to create array.",
   89|      0|		 function );
   90|       |
   91|      0|		goto on_error;
   92|      0|	}
   93|   348k|	if( memory_set(
  ------------------
  |  |  121|   348k|	memset( (void *) buffer, (int) value, count )
  ------------------
  |  Branch (93:6): [True: 0, False: 348k]
  ------------------
   94|   348k|	     internal_array,
   95|   348k|	     0,
   96|   348k|	     sizeof( libcdata_internal_array_t ) ) == NULL )
   97|      0|	{
   98|      0|		libcerror_error_set(
   99|      0|		 error,
  100|      0|		 LIBCERROR_ERROR_DOMAIN_MEMORY,
  101|      0|		 LIBCERROR_MEMORY_ERROR_SET_FAILED,
  102|      0|		 "%s: unable to clear array.",
  103|      0|		 function );
  104|       |
  105|      0|		memory_free(
  ------------------
  |  |  100|      0|	free( (void *) buffer )
  ------------------
  106|      0|		 internal_array );
  107|       |
  108|      0|		return( -1 );
  109|      0|	}
  110|       |	/* Pre-allocate in blocks of 16 entries
  111|       |	 */
  112|   348k|	if( number_of_entries >= (int) ( INT_MAX - 16 ) )
  ------------------
  |  Branch (112:6): [True: 0, False: 348k]
  ------------------
  113|      0|	{
  114|      0|		number_of_allocated_entries = INT_MAX;
  115|      0|	}
  116|   348k|	else
  117|   348k|	{
  118|   348k|		number_of_allocated_entries = ( number_of_entries & ~( 15 ) ) + 16;
  119|   348k|	}
  120|   348k|#if SIZEOF_INT <= SIZEOF_SIZE_T
  121|   348k|	if( (size_t) number_of_allocated_entries > (size_t) ( SSIZE_MAX / sizeof( intptr_t * ) ) )
  ------------------
  |  Branch (121:6): [True: 0, False: 348k]
  ------------------
  122|       |#else
  123|       |	if( number_of_allocated_entries > (int) ( SSIZE_MAX / sizeof( intptr_t * ) ) )
  124|       |#endif
  125|      0|	{
  126|      0|		libcerror_error_set(
  127|      0|		 error,
  128|      0|		 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  129|      0|		 LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM,
  130|      0|		 "%s: invalid number of allocated entries value exceeds maximum.",
  131|      0|		 function );
  132|       |
  133|      0|		goto on_error;
  134|      0|	}
  135|   348k|	entries_size = sizeof( intptr_t * ) * number_of_allocated_entries;
  136|       |
  137|   348k|	if( entries_size > (size_t) LIBCDATA_ARRAY_ENTRIES_MEMORY_LIMIT )
  ------------------
  |  |   78|   348k|#define LIBCDATA_ARRAY_ENTRIES_MEMORY_LIMIT	128 * 1024 * 1024
  ------------------
  |  Branch (137:6): [True: 0, False: 348k]
  ------------------
  138|      0|	{
  139|      0|		libcerror_error_set(
  140|      0|		 error,
  141|      0|		 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  142|      0|		 LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM,
  143|      0|		 "%s: invalid entries size value exceeds maximum.",
  144|      0|		 function );
  145|       |
  146|      0|		goto on_error;
  147|      0|	}
  148|   348k|	internal_array->entries = (intptr_t **) memory_allocate(
  ------------------
  |  |   60|   348k|	malloc( size )
  ------------------
  149|   348k|	                                         entries_size );
  150|       |
  151|   348k|	if( internal_array->entries == NULL )
  ------------------
  |  Branch (151:6): [True: 0, False: 348k]
  ------------------
  152|      0|	{
  153|      0|		libcerror_error_set(
  154|      0|		 error,
  155|      0|		 LIBCERROR_ERROR_DOMAIN_MEMORY,
  156|      0|		 LIBCERROR_MEMORY_ERROR_INSUFFICIENT,
  157|      0|		 "%s: unable to create array entries.",
  158|      0|		 function );
  159|       |
  160|      0|		goto on_error;
  161|      0|	}
  162|   348k|	if( memory_set(
  ------------------
  |  |  121|   348k|	memset( (void *) buffer, (int) value, count )
  ------------------
  |  Branch (162:6): [True: 0, False: 348k]
  ------------------
  163|   348k|	     internal_array->entries,
  164|   348k|	     0,
  165|   348k|	     entries_size ) == NULL )
  166|      0|	{
  167|      0|		libcerror_error_set(
  168|      0|		 error,
  169|      0|		 LIBCERROR_ERROR_DOMAIN_MEMORY,
  170|      0|		 LIBCERROR_MEMORY_ERROR_SET_FAILED,
  171|      0|		 "%s: unable to clear array entries.",
  172|      0|		 function );
  173|       |
  174|      0|		goto on_error;
  175|      0|	}
  176|   348k|	internal_array->number_of_allocated_entries = number_of_allocated_entries;
  177|   348k|	internal_array->number_of_entries           = number_of_entries;
  178|       |
  179|       |#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA )
  180|       |	if( libcthreads_read_write_lock_initialize(
  181|       |	     &( internal_array->read_write_lock ),
  182|       |	     error ) != 1 )
  183|       |	{
  184|       |		libcerror_error_set(
  185|       |		 error,
  186|       |		 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  187|       |		 LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED,
  188|       |		 "%s: unable to initialize read/write lock.",
  189|       |		 function );
  190|       |
  191|       |		goto on_error;
  192|       |	}
  193|       |#endif
  194|   348k|	*array = (libcdata_array_t *) internal_array;
  195|       |
  196|   348k|	return( 1 );
  197|       |
  198|      0|on_error:
  199|      0|	if( internal_array != NULL )
  ------------------
  |  Branch (199:6): [True: 0, False: 0]
  ------------------
  200|      0|	{
  201|      0|		if( internal_array->entries != NULL )
  ------------------
  |  Branch (201:7): [True: 0, False: 0]
  ------------------
  202|      0|		{
  203|      0|			memory_free(
  ------------------
  |  |  100|      0|	free( (void *) buffer )
  ------------------
  204|      0|			 internal_array->entries );
  205|      0|		}
  206|      0|		memory_free(
  ------------------
  |  |  100|      0|	free( (void *) buffer )
  ------------------
  207|      0|		 internal_array );
  208|      0|	}
  209|      0|	return( -1 );
  210|   348k|}
libcdata_array_free:
  222|   348k|{
  223|   348k|	libcdata_internal_array_t *internal_array = NULL;
  224|   348k|	static char *function                     = "libcdata_array_free";
  225|   348k|	int result                                = 1;
  226|       |
  227|   348k|	if( array == NULL )
  ------------------
  |  Branch (227:6): [True: 0, False: 348k]
  ------------------
  228|      0|	{
  229|      0|		libcerror_error_set(
  230|      0|		 error,
  231|      0|		 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
  232|      0|		 LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE,
  233|      0|		 "%s: invalid array.",
  234|      0|		 function );
  235|       |
  236|      0|		return( -1 );
  237|      0|	}
  238|   348k|	if( *array != NULL )
  ------------------
  |  Branch (238:6): [True: 348k, False: 0]
  ------------------
  239|   348k|	{
  240|   348k|		internal_array = (libcdata_internal_array_t *) *array;
  241|   348k|		*array         = NULL;
  242|       |
  243|       |#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA )
  244|       |		if( libcthreads_read_write_lock_free(
  245|       |		     &( internal_array->read_write_lock ),
  246|       |		     error ) != 1 )
  247|       |		{
  248|       |			libcerror_error_set(
  249|       |			 error,
  250|       |			 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  251|       |			 LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED,
  252|       |			 "%s: unable to free read/write lock.",
  253|       |			 function );
  254|       |
  255|       |			result = -1;
  256|       |		}
  257|       |#endif
  258|   348k|		if( internal_array->entries != NULL )
  ------------------
  |  Branch (258:7): [True: 348k, False: 0]
  ------------------
  259|   348k|		{
  260|   348k|			if( libcdata_internal_array_clear(
  ------------------
  |  Branch (260:8): [True: 0, False: 348k]
  ------------------
  261|   348k|			     internal_array,
  262|   348k|			     entry_free_function,
  263|   348k|			     error ) != 1 )
  264|      0|			{
  265|      0|				libcerror_error_set(
  266|      0|				 error,
  267|      0|				 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  268|      0|				 LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED,
  269|      0|				 "%s: unable to clear array.",
  270|      0|				 function );
  271|       |
  272|      0|				result = -1;
  273|      0|			}
  274|   348k|			memory_free(
  ------------------
  |  |  100|   348k|	free( (void *) buffer )
  ------------------
  275|   348k|			 internal_array->entries );
  276|   348k|		}
  277|   348k|		memory_free(
  ------------------
  |  |  100|   348k|	free( (void *) buffer )
  ------------------
  278|   348k|		 internal_array );
  279|   348k|	}
  280|   348k|	return( result );
  281|   348k|}
libcdata_array_empty:
  295|    654|{
  296|    654|	libcdata_internal_array_t *internal_array = NULL;
  297|    654|	static char *function                     = "libcdata_array_empty";
  298|    654|	int result                                = 1;
  299|       |
  300|    654|	if( array == NULL )
  ------------------
  |  Branch (300:6): [True: 0, False: 654]
  ------------------
  301|      0|	{
  302|      0|		libcerror_error_set(
  303|      0|		 error,
  304|      0|		 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
  305|      0|		 LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE,
  306|      0|		 "%s: invalid array.",
  307|      0|		 function );
  308|       |
  309|      0|		return( -1 );
  310|      0|	}
  311|    654|	internal_array = (libcdata_internal_array_t *) array;
  312|       |
  313|       |#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA )
  314|       |	if( libcthreads_read_write_lock_grab_for_write(
  315|       |	     internal_array->read_write_lock,
  316|       |	     error ) != 1 )
  317|       |	{
  318|       |		libcerror_error_set(
  319|       |		 error,
  320|       |		 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  321|       |		 LIBCERROR_RUNTIME_ERROR_SET_FAILED,
  322|       |		 "%s: unable to grab read/write lock for writing.",
  323|       |		 function );
  324|       |
  325|       |		return( -1 );
  326|       |	}
  327|       |#endif
  328|    654|	if( libcdata_internal_array_clear(
  ------------------
  |  Branch (328:6): [True: 0, False: 654]
  ------------------
  329|    654|	     internal_array,
  330|    654|	     entry_free_function,
  331|    654|	     error ) != 1 )
  332|      0|	{
  333|      0|		libcerror_error_set(
  334|      0|		 error,
  335|      0|		 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  336|      0|		 LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED,
  337|      0|		 "%s: unable to clear array.",
  338|      0|		 function );
  339|       |
  340|      0|		result = -1;
  341|      0|	}
  342|    654|	else
  343|    654|	{
  344|    654|		internal_array->number_of_entries = 0;
  345|    654|	}
  346|       |#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA )
  347|       |	if( libcthreads_read_write_lock_release_for_write(
  348|       |	     internal_array->read_write_lock,
  349|       |	     error ) != 1 )
  350|       |	{
  351|       |		libcerror_error_set(
  352|       |		 error,
  353|       |		 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  354|       |		 LIBCERROR_RUNTIME_ERROR_SET_FAILED,
  355|       |		 "%s: unable to release read/write lock for writing.",
  356|       |		 function );
  357|       |
  358|       |		return( -1 );
  359|       |	}
  360|       |#endif
  361|    654|	return( result );
  362|    654|}
libcdata_internal_array_clear:
  377|   349k|{
  378|   349k|	static char *function = "libcdata_internal_array_clear";
  379|   349k|	int entry_free_result = 0;
  380|   349k|	int entry_iterator    = 0;
  381|   349k|	int result            = 1;
  382|       |
  383|   349k|	if( internal_array == NULL )
  ------------------
  |  Branch (383:6): [True: 0, False: 349k]
  ------------------
  384|      0|	{
  385|      0|		libcerror_error_set(
  386|      0|		 error,
  387|      0|		 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
  388|      0|		 LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE,
  389|      0|		 "%s: invalid array.",
  390|      0|		 function );
  391|       |
  392|      0|		return( -1 );
  393|      0|	}
  394|   349k|	if( internal_array->entries == NULL )
  ------------------
  |  Branch (394:6): [True: 0, False: 349k]
  ------------------
  395|      0|	{
  396|      0|		libcerror_error_set(
  397|      0|		 error,
  398|      0|		 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  399|      0|		 LIBCERROR_RUNTIME_ERROR_VALUE_MISSING,
  400|      0|		 "%s: invalid array - missing entries.",
  401|      0|		 function );
  402|       |
  403|      0|		return( -1 );
  404|      0|	}
  405|   349k|	for( entry_iterator = 0;
  406|   702k|	     entry_iterator < internal_array->number_of_entries;
  ------------------
  |  Branch (406:7): [True: 353k, False: 349k]
  ------------------
  407|   353k|	     entry_iterator++ )
  408|   353k|	{
  409|   353k|		if( internal_array->entries[ entry_iterator ] != NULL )
  ------------------
  |  Branch (409:7): [True: 353k, False: 0]
  ------------------
  410|   353k|		{
  411|   353k|			if( entry_free_function == NULL )
  ------------------
  |  Branch (411:8): [True: 0, False: 353k]
  ------------------
  412|      0|			{
  413|      0|				entry_free_result = 1;
  414|      0|			}
  415|   353k|			else
  416|   353k|			{
  417|   353k|				entry_free_result = entry_free_function(
  418|   353k|				                     &( internal_array->entries[ entry_iterator ] ),
  419|   353k|				                     error );
  420|   353k|			}
  421|   353k|			if( entry_free_result != 1 )
  ------------------
  |  Branch (421:8): [True: 0, False: 353k]
  ------------------
  422|      0|			{
  423|      0|				libcerror_error_set(
  424|      0|				 error,
  425|      0|				 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  426|      0|				 LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED,
  427|      0|				 "%s: unable to free array entry: %d.",
  428|      0|				 function,
  429|      0|				 entry_iterator );
  430|       |
  431|      0|				result = -1;
  432|      0|			}
  433|   353k|			else
  434|   353k|			{
  435|   353k|				internal_array->entries[ entry_iterator ] = NULL;
  436|   353k|			}
  437|   353k|		}
  438|   353k|	}
  439|   349k|	return( result );
  440|   349k|}
libcdata_internal_array_resize:
  712|   353k|{
  713|   353k|	static char *function           = "libcdata_internal_array_resize";
  714|   353k|	void *reallocation              = NULL;
  715|   353k|	size_t entries_size             = 0;
  716|   353k|	int entry_iterator              = 0;
  717|   353k|	int number_of_allocated_entries = 0;
  718|   353k|	int result                      = 1;
  719|       |
  720|   353k|	if( internal_array == NULL )
  ------------------
  |  Branch (720:6): [True: 0, False: 353k]
  ------------------
  721|      0|	{
  722|      0|		libcerror_error_set(
  723|      0|		 error,
  724|      0|		 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
  725|      0|		 LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE,
  726|      0|		 "%s: invalid array.",
  727|      0|		 function );
  728|       |
  729|      0|		return( -1 );
  730|      0|	}
  731|   353k|	if( internal_array->entries == NULL )
  ------------------
  |  Branch (731:6): [True: 0, False: 353k]
  ------------------
  732|      0|	{
  733|      0|		libcerror_error_set(
  734|      0|		 error,
  735|      0|		 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  736|      0|		 LIBCERROR_RUNTIME_ERROR_VALUE_MISSING,
  737|      0|		 "%s: invalid array - missing entries.",
  738|      0|		 function );
  739|       |
  740|      0|		return( -1 );
  741|      0|	}
  742|   353k|	if( number_of_entries < 0 )
  ------------------
  |  Branch (742:6): [True: 0, False: 353k]
  ------------------
  743|      0|	{
  744|      0|		libcerror_error_set(
  745|      0|		 error,
  746|      0|		 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
  747|      0|		 LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO,
  748|      0|		 "%s: invalid number of entries value less than zero.",
  749|      0|		 function );
  750|       |
  751|      0|		return( -1 );
  752|      0|	}
  753|   353k|	if( number_of_entries > internal_array->number_of_allocated_entries )
  ------------------
  |  Branch (753:6): [True: 21.6k, False: 331k]
  ------------------
  754|  21.6k|	{
  755|       |		/* Pre-allocate in blocks of 16 entries
  756|       |		 */
  757|  21.6k|		if( number_of_entries >= (int) ( INT_MAX - 16 ) )
  ------------------
  |  Branch (757:7): [True: 0, False: 21.6k]
  ------------------
  758|      0|		{
  759|      0|			number_of_allocated_entries = INT_MAX;
  760|      0|		}
  761|  21.6k|		else
  762|  21.6k|		{
  763|  21.6k|			number_of_allocated_entries = ( number_of_entries & ~( 15 ) ) + 16;
  764|  21.6k|		}
  765|  21.6k|#if SIZEOF_INT <= SIZEOF_SIZE_T
  766|  21.6k|		if( (size_t) number_of_allocated_entries > (size_t) ( SSIZE_MAX / sizeof( intptr_t * ) ) )
  ------------------
  |  Branch (766:7): [True: 0, False: 21.6k]
  ------------------
  767|       |#else
  768|       |		if( number_of_allocated_entries > (int) ( SSIZE_MAX / sizeof( intptr_t * ) ) )
  769|       |#endif
  770|      0|		{
  771|      0|			libcerror_error_set(
  772|      0|			 error,
  773|      0|			 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  774|      0|			 LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM,
  775|      0|			 "%s: invalid number of allocated entries value exceeds maximum.",
  776|      0|			 function );
  777|       |
  778|      0|			return( -1 );
  779|      0|		}
  780|  21.6k|		entries_size = sizeof( intptr_t * ) * number_of_allocated_entries;
  781|       |
  782|  21.6k|		if( entries_size > (size_t) LIBCDATA_ARRAY_ENTRIES_MEMORY_LIMIT )
  ------------------
  |  |   78|  21.6k|#define LIBCDATA_ARRAY_ENTRIES_MEMORY_LIMIT	128 * 1024 * 1024
  ------------------
  |  Branch (782:7): [True: 0, False: 21.6k]
  ------------------
  783|      0|		{
  784|      0|			libcerror_error_set(
  785|      0|			 error,
  786|      0|			 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  787|      0|			 LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM,
  788|      0|			 "%s: invalid entries size value exceeds maximum.",
  789|      0|			 function );
  790|       |
  791|      0|			return( -1 );
  792|      0|		}
  793|  21.6k|		reallocation = memory_reallocate(
  ------------------
  |  |   85|  21.6k|	realloc( (void *) buffer, size )
  ------------------
  794|  21.6k|		                internal_array->entries,
  795|  21.6k|		                entries_size );
  796|       |
  797|  21.6k|		if( reallocation == NULL )
  ------------------
  |  Branch (797:7): [True: 0, False: 21.6k]
  ------------------
  798|      0|		{
  799|      0|			libcerror_error_set(
  800|      0|			 error,
  801|      0|			 LIBCERROR_ERROR_DOMAIN_MEMORY,
  802|      0|			 LIBCERROR_MEMORY_ERROR_INSUFFICIENT,
  803|      0|			 "%s: unable to resize array entries.",
  804|      0|			 function );
  805|       |
  806|      0|			return( -1 );
  807|      0|		}
  808|  21.6k|		internal_array->entries = (intptr_t **) reallocation;
  809|       |
  810|       |		/* Cannot use memset reliably here. The loop below will be removed
  811|       |		 * when memset is used and the code is optimized. Therefore the loop
  812|       |		 * is not executed when memset fails.
  813|       |		 */
  814|  21.6k|		for( entry_iterator = internal_array->number_of_allocated_entries;
  815|   368k|		     entry_iterator < number_of_allocated_entries;
  ------------------
  |  Branch (815:8): [True: 347k, False: 21.6k]
  ------------------
  816|   347k|		     entry_iterator++ )
  817|   347k|		{
  818|   347k|			internal_array->entries[ entry_iterator ] = NULL;
  819|   347k|		}
  820|  21.6k|		internal_array->number_of_allocated_entries = number_of_allocated_entries;
  821|  21.6k|		internal_array->number_of_entries           = number_of_entries;
  822|  21.6k|	}
  823|   331k|	else if( number_of_entries > internal_array->number_of_entries )
  ------------------
  |  Branch (823:11): [True: 331k, False: 0]
  ------------------
  824|   331k|	{
  825|   331k|		internal_array->number_of_entries = number_of_entries;
  826|   331k|	}
  827|      0|	else if( internal_array->entries != NULL )
  ------------------
  |  Branch (827:11): [True: 0, False: 0]
  ------------------
  828|      0|	{
  829|      0|		for( entry_iterator = number_of_entries;
  830|      0|		     entry_iterator < internal_array->number_of_entries;
  ------------------
  |  Branch (830:8): [True: 0, False: 0]
  ------------------
  831|      0|		     entry_iterator++ )
  832|      0|		{
  833|      0|			if( internal_array->entries[ entry_iterator ] != NULL )
  ------------------
  |  Branch (833:8): [True: 0, False: 0]
  ------------------
  834|      0|			{
  835|      0|				if( entry_free_function == NULL )
  ------------------
  |  Branch (835:9): [True: 0, False: 0]
  ------------------
  836|      0|				{
  837|      0|					libcerror_error_set(
  838|      0|					 error,
  839|      0|					 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
  840|      0|					 LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE,
  841|      0|					 "%s: invalid entry free function.",
  842|      0|					 function );
  843|       |
  844|      0|					return( -1 );
  845|      0|				}
  846|      0|				if( entry_free_function(
  ------------------
  |  Branch (846:9): [True: 0, False: 0]
  ------------------
  847|      0|				     &( internal_array->entries[ entry_iterator ] ),
  848|      0|				     error ) != 1 )
  849|      0|				{
  850|      0|					libcerror_error_set(
  851|      0|					 error,
  852|      0|					 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  853|      0|					 LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED,
  854|      0|					 "%s: unable to free array entry: %d.",
  855|      0|					 function,
  856|      0|					 entry_iterator );
  857|       |
  858|      0|					result = -1;
  859|      0|				}
  860|      0|				internal_array->entries[ entry_iterator ] = NULL;
  861|      0|			}
  862|      0|		}
  863|      0|		internal_array->number_of_entries = number_of_entries;
  864|      0|	}
  865|   353k|	return( result );
  866|   353k|}
libcdata_array_append_entry:
 1545|   353k|{
 1546|   353k|	libcdata_internal_array_t *internal_array = NULL;
 1547|   353k|	static char *function                     = "libcdata_array_append_entry";
 1548|   353k|	int result                                = 0;
 1549|   353k|	int safe_entry_index                      = 0;
 1550|       |
 1551|   353k|	if( array == NULL )
  ------------------
  |  Branch (1551:6): [True: 0, False: 353k]
  ------------------
 1552|      0|	{
 1553|      0|		libcerror_error_set(
 1554|      0|		 error,
 1555|      0|		 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
 1556|      0|		 LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE,
 1557|      0|		 "%s: invalid array.",
 1558|      0|		 function );
 1559|       |
 1560|      0|		return( -1 );
 1561|      0|	}
 1562|   353k|	internal_array = (libcdata_internal_array_t *) array;
 1563|       |
 1564|   353k|	if( internal_array->entries == NULL )
  ------------------
  |  Branch (1564:6): [True: 0, False: 353k]
  ------------------
 1565|      0|	{
 1566|      0|		libcerror_error_set(
 1567|      0|		 error,
 1568|      0|		 LIBCERROR_ERROR_DOMAIN_RUNTIME,
 1569|      0|		 LIBCERROR_RUNTIME_ERROR_VALUE_MISSING,
 1570|      0|		 "%s: invalid array - missing entries.",
 1571|      0|		 function );
 1572|       |
 1573|      0|		return( -1 );
 1574|      0|	}
 1575|   353k|	if( entry_index == NULL )
  ------------------
  |  Branch (1575:6): [True: 0, False: 353k]
  ------------------
 1576|      0|	{
 1577|      0|		libcerror_error_set(
 1578|      0|		 error,
 1579|      0|		 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
 1580|      0|		 LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE,
 1581|      0|		 "%s: invalid entry index.",
 1582|      0|		 function );
 1583|       |
 1584|      0|		return( -1 );
 1585|      0|	}
 1586|       |#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA )
 1587|       |	if( libcthreads_read_write_lock_grab_for_write(
 1588|       |	     internal_array->read_write_lock,
 1589|       |	     error ) != 1 )
 1590|       |	{
 1591|       |		libcerror_error_set(
 1592|       |		 error,
 1593|       |		 LIBCERROR_ERROR_DOMAIN_RUNTIME,
 1594|       |		 LIBCERROR_RUNTIME_ERROR_SET_FAILED,
 1595|       |		 "%s: unable to grab read/write lock for writing.",
 1596|       |		 function );
 1597|       |
 1598|       |		return( -1 );
 1599|       |	}
 1600|       |#endif
 1601|   353k|	safe_entry_index = internal_array->number_of_entries;
 1602|       |
 1603|   353k|	result = libcdata_internal_array_resize(
 1604|   353k|	          internal_array,
 1605|   353k|	          internal_array->number_of_entries + 1,
 1606|   353k|	          NULL,
 1607|   353k|	          error );
 1608|       |
 1609|   353k|	if( result != 1 )
  ------------------
  |  Branch (1609:6): [True: 0, False: 353k]
  ------------------
 1610|      0|	{
 1611|      0|		libcerror_error_set(
 1612|      0|		 error,
 1613|      0|		 LIBCERROR_ERROR_DOMAIN_RUNTIME,
 1614|      0|		 LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED,
 1615|      0|		 "%s: unable to resize array.",
 1616|      0|		 function );
 1617|       |
 1618|      0|		result = -1;
 1619|      0|	}
 1620|   353k|	else
 1621|   353k|	{
 1622|   353k|		internal_array->entries[ safe_entry_index ] = entry;
 1623|   353k|	}
 1624|       |#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA )
 1625|       |	if( libcthreads_read_write_lock_release_for_write(
 1626|       |	     internal_array->read_write_lock,
 1627|       |	     error ) != 1 )
 1628|       |	{
 1629|       |		libcerror_error_set(
 1630|       |		 error,
 1631|       |		 LIBCERROR_ERROR_DOMAIN_RUNTIME,
 1632|       |		 LIBCERROR_RUNTIME_ERROR_SET_FAILED,
 1633|       |		 "%s: unable to release read/write lock for writing.",
 1634|       |		 function );
 1635|       |
 1636|       |		goto on_error;
 1637|       |	}
 1638|       |#endif
 1639|   353k|	if( result == 1 )
  ------------------
  |  Branch (1639:6): [True: 353k, False: 0]
  ------------------
 1640|   353k|	{
 1641|   353k|		*entry_index = safe_entry_index;
 1642|   353k|	}
 1643|   353k|	return( result );
 1644|       |
 1645|       |#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA )
 1646|       |on_error:
 1647|       |	if( result == 1 )
 1648|       |	{
 1649|       |		internal_array->entries[ safe_entry_index ] = NULL;
 1650|       |
 1651|       |		internal_array->number_of_entries -= 1;
 1652|       |	}
 1653|       |	return( -1 );
 1654|       |#endif
 1655|   353k|}

libcerror_error_set:
  314|  1.40k|{
  315|  1.40k|	va_list argument_list;
  316|       |
  317|  1.40k|	libcerror_internal_error_t *internal_error = NULL;
  318|  1.40k|	system_character_t *error_string           = NULL;
  319|  1.40k|	system_character_t *system_format_string   = NULL;
  320|  1.40k|	void *reallocation                         = NULL;
  321|  1.40k|	size_t error_string_size                   = 0;
  322|  1.40k|	size_t format_string_length                = 0;
  323|  1.40k|	size_t message_size                        = 0;
  324|  1.40k|	size_t next_message_size                   = LIBCERROR_MESSAGE_INCREMENT_SIZE;
  ------------------
  |  |  322|  1.40k|#define LIBCERROR_MESSAGE_INCREMENT_SIZE		64
  ------------------
  325|  1.40k|	int message_index                          = 0;
  326|  1.40k|	int print_count                            = 0;
  327|       |
  328|  1.40k|	if( error == NULL )
  ------------------
  |  Branch (328:6): [True: 1.40k, False: 0]
  ------------------
  329|  1.40k|	{
  330|  1.40k|		return;
  331|  1.40k|	}
  332|      0|	if( format_string == NULL )
  ------------------
  |  Branch (332:6): [True: 0, False: 0]
  ------------------
  333|      0|	{
  334|      0|		return;
  335|      0|	}
  336|      0|	format_string_length = narrow_string_length(
  ------------------
  |  |   59|      0|	strlen( string )
  ------------------
  337|      0|	                        format_string );
  338|       |
  339|       |#if defined( HAVE_WIDE_SYSTEM_CHARACTER )
  340|       |	libcerror_error_get_system_format_string(
  341|       |	 format_string,
  342|       |	 format_string_length,
  343|       |	 &system_format_string );
  344|       |
  345|       |	if( system_format_string == NULL )
  346|       |	{
  347|       |		return;
  348|       |	}
  349|       |#else
  350|      0|	system_format_string = (system_character_t *) format_string;
  351|      0|#endif
  352|      0|	if( *error == NULL )
  ------------------
  |  Branch (352:6): [True: 0, False: 0]
  ------------------
  353|      0|	{
  354|      0|		if( libcerror_error_initialize(
  ------------------
  |  Branch (354:7): [True: 0, False: 0]
  ------------------
  355|      0|		     error,
  356|      0|		     error_domain,
  357|      0|		     error_code ) != 1 )
  358|      0|		{
  359|      0|			goto on_error;
  360|      0|		}
  361|      0|	}
  362|      0|	internal_error = (libcerror_internal_error_t *) *error;
  363|       |
  364|      0|	if( libcerror_error_resize(
  ------------------
  |  Branch (364:6): [True: 0, False: 0]
  ------------------
  365|      0|	     internal_error ) != 1 )
  366|      0|	{
  367|      0|		goto on_error;
  368|      0|	}
  369|      0|	if( format_string_length > next_message_size )
  ------------------
  |  Branch (369:6): [True: 0, False: 0]
  ------------------
  370|      0|	{
  371|      0|		next_message_size = ( ( format_string_length / LIBCERROR_MESSAGE_INCREMENT_SIZE ) + 1 )
  ------------------
  |  |  322|      0|#define LIBCERROR_MESSAGE_INCREMENT_SIZE		64
  ------------------
  372|      0|		                  * LIBCERROR_MESSAGE_INCREMENT_SIZE;
  ------------------
  |  |  322|      0|#define LIBCERROR_MESSAGE_INCREMENT_SIZE		64
  ------------------
  373|      0|	}
  374|      0|	do
  375|      0|	{
  376|      0|		if( next_message_size >= LIBCERROR_MESSAGE_MAXIMUM_SIZE )
  ------------------
  |  |  323|      0|#define LIBCERROR_MESSAGE_MAXIMUM_SIZE			4096
  ------------------
  |  Branch (376:7): [True: 0, False: 0]
  ------------------
  377|      0|		{
  378|      0|			next_message_size = LIBCERROR_MESSAGE_MAXIMUM_SIZE;
  ------------------
  |  |  323|      0|#define LIBCERROR_MESSAGE_MAXIMUM_SIZE			4096
  ------------------
  379|      0|		}
  380|      0|		reallocation = memory_reallocate(
  ------------------
  |  |   85|      0|	realloc( (void *) buffer, size )
  ------------------
  381|      0|		                error_string,
  382|      0|		                sizeof( system_character_t ) * next_message_size );
  383|       |
  384|      0|		if( reallocation == NULL )
  ------------------
  |  Branch (384:7): [True: 0, False: 0]
  ------------------
  385|      0|		{
  386|      0|			memory_free(
  ------------------
  |  |  100|      0|	free( (void *) buffer )
  ------------------
  387|      0|			 error_string );
  388|       |
  389|      0|			goto on_error;
  390|      0|		}
  391|      0|		error_string = (system_character_t *) reallocation;
  392|       |
  393|      0|		message_size = next_message_size;
  394|       |
  395|       |		/* argument_list cannot be reused in successive calls to vsnprintf
  396|       |		 */
  397|      0|		VASTART(
  ------------------
  |  |  289|      0|        va_start( argument_list, name )
  ------------------
  398|      0|		 argument_list,
  399|      0|		 const char *,
  400|      0|		 format_string );
  401|       |
  402|      0|		print_count = system_string_vsnprintf(
  ------------------
  |  |  141|      0|	narrow_string_vsnprintf( string, size, format, __VA_ARGS__ )
  |  |  ------------------
  |  |  |  |  179|      0|	vsnprintf( string, size, format, __VA_ARGS__ )
  |  |  ------------------
  ------------------
  403|      0|		               error_string,
  404|      0|		               message_size,
  405|      0|		               system_format_string,
  406|      0|		               argument_list );
  407|       |
  408|      0|		VAEND(
  ------------------
  |  |  291|      0|        va_end( argument_list )
  ------------------
  409|      0|		 argument_list );
  410|       |
  411|      0|		if( print_count <= -1 )
  ------------------
  |  Branch (411:7): [True: 0, False: 0]
  ------------------
  412|      0|		{
  413|      0|			next_message_size += LIBCERROR_MESSAGE_INCREMENT_SIZE;
  ------------------
  |  |  322|      0|#define LIBCERROR_MESSAGE_INCREMENT_SIZE		64
  ------------------
  414|      0|		}
  415|      0|		else if( ( (size_t) print_count >= message_size )
  ------------------
  |  Branch (415:12): [True: 0, False: 0]
  ------------------
  416|      0|		      || ( error_string[ print_count ] != (system_character_t) 0 ) )
  ------------------
  |  Branch (416:12): [True: 0, False: 0]
  ------------------
  417|      0|		{
  418|      0|			next_message_size = (size_t) ( print_count + 1 );
  419|      0|			print_count       = -1;
  420|      0|		}
  421|      0|		else
  422|      0|		{
  423|      0|			error_string_size = (size_t) print_count + 1;
  424|      0|		}
  425|      0|		if( message_size >= LIBCERROR_MESSAGE_MAXIMUM_SIZE )
  ------------------
  |  |  323|      0|#define LIBCERROR_MESSAGE_MAXIMUM_SIZE			4096
  ------------------
  |  Branch (425:7): [True: 0, False: 0]
  ------------------
  426|      0|		{
  427|      0|			break;
  428|      0|		}
  429|      0|	}
  430|      0|	while( print_count <= -1 );
  ------------------
  |  Branch (430:9): [True: 0, False: 0]
  ------------------
  431|       |
  432|      0|	if( message_size >= LIBCERROR_MESSAGE_MAXIMUM_SIZE )
  ------------------
  |  |  323|      0|#define LIBCERROR_MESSAGE_MAXIMUM_SIZE			4096
  ------------------
  |  Branch (432:6): [True: 0, False: 0]
  ------------------
  433|      0|	{
  434|      0|		error_string[ LIBCERROR_MESSAGE_MAXIMUM_SIZE - 4 ] = (system_character_t) '.';
  ------------------
  |  |  323|      0|#define LIBCERROR_MESSAGE_MAXIMUM_SIZE			4096
  ------------------
  435|      0|		error_string[ LIBCERROR_MESSAGE_MAXIMUM_SIZE - 3 ] = (system_character_t) '.';
  ------------------
  |  |  323|      0|#define LIBCERROR_MESSAGE_MAXIMUM_SIZE			4096
  ------------------
  436|      0|		error_string[ LIBCERROR_MESSAGE_MAXIMUM_SIZE - 2 ] = (system_character_t) '.';
  ------------------
  |  |  323|      0|#define LIBCERROR_MESSAGE_MAXIMUM_SIZE			4096
  ------------------
  437|      0|		error_string[ LIBCERROR_MESSAGE_MAXIMUM_SIZE - 1 ] = 0;
  ------------------
  |  |  323|      0|#define LIBCERROR_MESSAGE_MAXIMUM_SIZE			4096
  ------------------
  438|      0|		error_string_size                                  = (size_t) LIBCERROR_MESSAGE_MAXIMUM_SIZE;
  ------------------
  |  |  323|      0|#define LIBCERROR_MESSAGE_MAXIMUM_SIZE			4096
  ------------------
  439|      0|	}
  440|      0|	message_index = internal_error->number_of_messages - 1;
  441|       |
  442|      0|	internal_error->messages[ message_index ] = error_string;
  443|      0|	internal_error->sizes[ message_index ]    = error_string_size;
  444|       |
  445|       |#if defined( HAVE_WIDE_SYSTEM_CHARACTER )
  446|       |	memory_free(
  447|       |	 system_format_string );
  448|       |
  449|       |	system_format_string = NULL;
  450|       |#endif
  451|      0|	return;
  452|       |
  453|      0|on_error:
  454|       |#if defined( HAVE_WIDE_SYSTEM_CHARACTER )
  455|       |	if( system_format_string != NULL )
  456|       |	{
  457|       |		memory_free(
  458|       |		 system_format_string );
  459|       |	}
  460|       |#endif
  461|      0|	return;
  462|      0|}

libfwps_record_initialize:
   46|  6.34k|{
   47|  6.34k|	libfwps_internal_record_t *internal_record = NULL;
   48|  6.34k|	static char *function                      = "libfwps_record_initialize";
   49|       |
   50|  6.34k|	if( record == NULL )
  ------------------
  |  Branch (50:6): [True: 0, False: 6.34k]
  ------------------
   51|      0|	{
   52|      0|		libcerror_error_set(
   53|      0|		 error,
   54|      0|		 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
   55|      0|		 LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE,
   56|      0|		 "%s: invalid record.",
   57|      0|		 function );
   58|       |
   59|      0|		return( -1 );
   60|      0|	}
   61|  6.34k|	if( *record != NULL )
  ------------------
  |  Branch (61:6): [True: 0, False: 6.34k]
  ------------------
   62|      0|	{
   63|      0|		libcerror_error_set(
   64|      0|		 error,
   65|      0|		 LIBCERROR_ERROR_DOMAIN_RUNTIME,
   66|      0|		 LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET,
   67|      0|		 "%s: invalid record value already set.",
   68|      0|		 function );
   69|       |
   70|      0|		return( -1 );
   71|      0|	}
   72|  6.34k|	if( ( record_type != LIBFWPS_RECORD_TYPE_NAMED )
  ------------------
  |  Branch (72:6): [True: 4.37k, False: 1.97k]
  ------------------
   73|  6.34k|	 && ( record_type != LIBFWPS_RECORD_TYPE_NUMERIC ) )
  ------------------
  |  Branch (73:6): [True: 0, False: 4.37k]
  ------------------
   74|      0|	{
   75|      0|		libcerror_error_set(
   76|      0|		 error,
   77|      0|		 LIBCERROR_ERROR_DOMAIN_RUNTIME,
   78|      0|		 LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE,
   79|      0|		 "%s: unsupported record type.",
   80|      0|		 function );
   81|       |
   82|      0|		return( -1 );
   83|      0|	}
   84|  6.34k|	internal_record = memory_allocate_structure(
  ------------------
  |  |   64|  6.34k|	(type *) memory_allocate( sizeof( type ) )
  |  |  ------------------
  |  |  |  |   60|  6.34k|	malloc( size )
  |  |  ------------------
  ------------------
   85|  6.34k|	                   libfwps_internal_record_t );
   86|       |
   87|  6.34k|	if( internal_record == NULL )
  ------------------
  |  Branch (87:6): [True: 0, False: 6.34k]
  ------------------
   88|      0|	{
   89|      0|		libcerror_error_set(
   90|      0|		 error,
   91|      0|		 LIBCERROR_ERROR_DOMAIN_MEMORY,
   92|      0|		 LIBCERROR_MEMORY_ERROR_INSUFFICIENT,
   93|      0|		 "%s: unable to create record.",
   94|      0|		 function );
   95|       |
   96|      0|		goto on_error;
   97|      0|	}
   98|  6.34k|	if( memory_set(
  ------------------
  |  |  121|  6.34k|	memset( (void *) buffer, (int) value, count )
  ------------------
  |  Branch (98:6): [True: 0, False: 6.34k]
  ------------------
   99|  6.34k|	     internal_record,
  100|  6.34k|	     0,
  101|  6.34k|	     sizeof( libfwps_internal_record_t ) ) == NULL )
  102|      0|	{
  103|      0|		libcerror_error_set(
  104|      0|		 error,
  105|      0|		 LIBCERROR_ERROR_DOMAIN_MEMORY,
  106|      0|		 LIBCERROR_MEMORY_ERROR_SET_FAILED,
  107|      0|		 "%s: unable to clear record.",
  108|      0|		 function );
  109|       |
  110|      0|		goto on_error;
  111|      0|	}
  112|  6.34k|	internal_record->type = record_type;
  113|       |
  114|  6.34k|	*record = (libfwps_record_t *) internal_record;
  115|       |
  116|  6.34k|	return( 1 );
  117|       |
  118|      0|on_error:
  119|      0|	if( internal_record != NULL )
  ------------------
  |  Branch (119:6): [True: 0, False: 0]
  ------------------
  120|      0|	{
  121|      0|		memory_free(
  ------------------
  |  |  100|      0|	free( (void *) buffer )
  ------------------
  122|      0|		 internal_record );
  123|      0|	}
  124|      0|	return( -1 );
  125|  6.34k|}
libfwps_internal_record_free:
  160|  6.34k|{
  161|  6.34k|	static char *function = "libfwps_internal_record_free";
  162|       |
  163|  6.34k|	if( internal_record == NULL )
  ------------------
  |  Branch (163:6): [True: 0, False: 6.34k]
  ------------------
  164|      0|	{
  165|      0|		libcerror_error_set(
  166|      0|		 error,
  167|      0|		 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
  168|      0|		 LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE,
  169|      0|		 "%s: invalid internal record.",
  170|      0|		 function );
  171|       |
  172|      0|		return( -1 );
  173|      0|	}
  174|  6.34k|	if( *internal_record != NULL )
  ------------------
  |  Branch (174:6): [True: 6.34k, False: 0]
  ------------------
  175|  6.34k|	{
  176|  6.34k|		if( ( *internal_record )->entry_name != NULL )
  ------------------
  |  Branch (176:7): [True: 1.87k, False: 4.47k]
  ------------------
  177|  1.87k|		{
  178|  1.87k|			memory_free(
  ------------------
  |  |  100|  1.87k|	free( (void *) buffer )
  ------------------
  179|  1.87k|			 ( *internal_record )->entry_name );
  180|  1.87k|		}
  181|  6.34k|		if( ( *internal_record )->value_name != NULL )
  ------------------
  |  Branch (181:7): [True: 0, False: 6.34k]
  ------------------
  182|      0|		{
  183|      0|			memory_free(
  ------------------
  |  |  100|      0|	free( (void *) buffer )
  ------------------
  184|      0|			 ( *internal_record )->value_name );
  185|      0|		}
  186|  6.34k|		if( ( *internal_record )->value_data != NULL )
  ------------------
  |  Branch (186:7): [True: 5.48k, False: 864]
  ------------------
  187|  5.48k|		{
  188|  5.48k|			memory_free(
  ------------------
  |  |  100|  5.48k|	free( (void *) buffer )
  ------------------
  189|  5.48k|			 ( *internal_record )->value_data );
  190|  5.48k|		}
  191|  6.34k|		memory_free(
  ------------------
  |  |  100|  6.34k|	free( (void *) buffer )
  ------------------
  192|  6.34k|		 *internal_record );
  193|       |
  194|  6.34k|		*internal_record = NULL;
  195|  6.34k|	}
  196|  6.34k|	return( 1 );
  197|  6.34k|}
libfwps_record_copy_from_byte_stream:
  208|  6.34k|{
  209|  6.34k|	libfwps_internal_record_t *internal_record = NULL;
  210|  6.34k|	static char *function                      = "libfwps_record_copy_from_byte_stream";
  211|  6.34k|	size_t byte_stream_offset                  = 0;
  212|  6.34k|	uint32_t name_size                         = 0;
  213|       |
  214|       |#if defined( HAVE_DEBUG_OUTPUT )
  215|       |	system_character_t *value_string           = NULL;
  216|       |	uint16_t value_16bit                       = 0;
  217|       |#endif
  218|       |
  219|  6.34k|	if( record == NULL )
  ------------------
  |  Branch (219:6): [True: 0, False: 6.34k]
  ------------------
  220|      0|	{
  221|      0|		libcerror_error_set(
  222|      0|		 error,
  223|      0|		 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
  224|      0|		 LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE,
  225|      0|		 "%s: invalid record.",
  226|      0|		 function );
  227|       |
  228|      0|		return( -1 );
  229|      0|	}
  230|  6.34k|	internal_record = (libfwps_internal_record_t *) record;
  231|       |
  232|  6.34k|	if( internal_record->entry_name != NULL )
  ------------------
  |  Branch (232:6): [True: 0, False: 6.34k]
  ------------------
  233|      0|	{
  234|      0|		libcerror_error_set(
  235|      0|		 error,
  236|      0|		 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  237|      0|		 LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET,
  238|      0|		 "%s: invalid record - entry name already set.",
  239|      0|		 function );
  240|       |
  241|      0|		return( -1 );
  242|      0|	}
  243|  6.34k|	if( internal_record->value_name != NULL )
  ------------------
  |  Branch (243:6): [True: 0, False: 6.34k]
  ------------------
  244|      0|	{
  245|      0|		libcerror_error_set(
  246|      0|		 error,
  247|      0|		 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  248|      0|		 LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET,
  249|      0|		 "%s: invalid record - value name already set.",
  250|      0|		 function );
  251|       |
  252|      0|		return( -1 );
  253|      0|	}
  254|  6.34k|	if( internal_record->value_data != NULL )
  ------------------
  |  Branch (254:6): [True: 0, False: 6.34k]
  ------------------
  255|      0|	{
  256|      0|		libcerror_error_set(
  257|      0|		 error,
  258|      0|		 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  259|      0|		 LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET,
  260|      0|		 "%s: invalid record - value data already set.",
  261|      0|		 function );
  262|       |
  263|      0|		return( -1 );
  264|      0|	}
  265|  6.34k|	if( byte_stream == NULL )
  ------------------
  |  Branch (265:6): [True: 0, False: 6.34k]
  ------------------
  266|      0|	{
  267|      0|		libcerror_error_set(
  268|      0|		 error,
  269|      0|		 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
  270|      0|		 LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE,
  271|      0|		 "%s: invalid byte stream.",
  272|      0|		 function );
  273|       |
  274|      0|		return( -1 );
  275|      0|	}
  276|  6.34k|	if( ( byte_stream_size < 13 )
  ------------------
  |  Branch (276:6): [True: 33, False: 6.31k]
  ------------------
  277|  6.34k|	 || ( byte_stream_size > (size_t) SSIZE_MAX ) )
  ------------------
  |  Branch (277:6): [True: 0, False: 6.31k]
  ------------------
  278|     33|	{
  279|     33|		libcerror_error_set(
  280|     33|		 error,
  281|     33|		 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
  282|     33|		 LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS,
  283|     33|		 "%s: invalid byte stream size value out of bounds.",
  284|     33|		 function );
  285|       |
  286|     33|		return( -1 );
  287|     33|	}
  288|  6.31k|	byte_stream_copy_to_uint32_little_endian(
  ------------------
  |  |   88|  6.31k|	( value )   = ( byte_stream )[ 3 ]; \
  |  |   89|  6.31k|	( value ) <<= 8; \
  |  |   90|  6.31k|	( value )  |= ( byte_stream )[ 2 ]; \
  |  |   91|  6.31k|	( value ) <<= 8; \
  |  |   92|  6.31k|	( value )  |= ( byte_stream )[ 1 ]; \
  |  |   93|  6.31k|	( value ) <<= 8; \
  |  |   94|  6.31k|	( value )  |= ( byte_stream )[ 0 ];
  ------------------
  289|  6.31k|	 byte_stream,
  290|  6.31k|	 internal_record->size );
  291|       |
  292|  6.31k|	if( ( internal_record->size < 13 )
  ------------------
  |  Branch (292:6): [True: 0, False: 6.31k]
  ------------------
  293|  6.31k|	 || ( (size_t) internal_record->size > byte_stream_size ) )
  ------------------
  |  Branch (293:6): [True: 0, False: 6.31k]
  ------------------
  294|      0|	{
  295|      0|		libcerror_error_set(
  296|      0|		 error,
  297|      0|		 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  298|      0|		 LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS,
  299|      0|		 "%s: invalid record - size value out of bounds.",
  300|      0|		 function );
  301|       |
  302|      0|		goto on_error;
  303|      0|	}
  304|       |#if defined( HAVE_DEBUG_OUTPUT )
  305|       |	if( libcnotify_verbose != 0 )
  306|       |	{
  307|       |		libcnotify_printf(
  308|       |		 "%s: record data:\n",
  309|       |		 function );
  310|       |		libcnotify_print_data(
  311|       |		 byte_stream,
  312|       |		 internal_record->size,
  313|       |		 LIBCNOTIFY_PRINT_DATA_FLAG_GROUP_DATA );
  314|       |	}
  315|       |#endif
  316|  6.31k|	if( internal_record->type == LIBFWPS_RECORD_TYPE_NAMED )
  ------------------
  |  Branch (316:6): [True: 1.96k, False: 4.34k]
  ------------------
  317|  1.96k|	{
  318|  1.96k|		byte_stream_copy_to_uint32_little_endian(
  ------------------
  |  |   88|  1.96k|	( value )   = ( byte_stream )[ 3 ]; \
  |  |   89|  1.96k|	( value ) <<= 8; \
  |  |   90|  1.96k|	( value )  |= ( byte_stream )[ 2 ]; \
  |  |   91|  1.96k|	( value ) <<= 8; \
  |  |   92|  1.96k|	( value )  |= ( byte_stream )[ 1 ]; \
  |  |   93|  1.96k|	( value ) <<= 8; \
  |  |   94|  1.96k|	( value )  |= ( byte_stream )[ 0 ];
  ------------------
  319|  1.96k|		 &( byte_stream[ byte_stream_offset + 4 ] ),
  320|  1.96k|		 name_size );
  321|  1.96k|	}
  322|  4.34k|	else if( internal_record->type == LIBFWPS_RECORD_TYPE_NUMERIC )
  ------------------
  |  Branch (322:11): [True: 4.34k, False: 0]
  ------------------
  323|  4.34k|	{
  324|  4.34k|		byte_stream_copy_to_uint32_little_endian(
  ------------------
  |  |   88|  4.34k|	( value )   = ( byte_stream )[ 3 ]; \
  |  |   89|  4.34k|	( value ) <<= 8; \
  |  |   90|  4.34k|	( value )  |= ( byte_stream )[ 2 ]; \
  |  |   91|  4.34k|	( value ) <<= 8; \
  |  |   92|  4.34k|	( value )  |= ( byte_stream )[ 1 ]; \
  |  |   93|  4.34k|	( value ) <<= 8; \
  |  |   94|  4.34k|	( value )  |= ( byte_stream )[ 0 ];
  ------------------
  325|  4.34k|		 &( byte_stream[ byte_stream_offset + 4 ] ),
  326|  4.34k|		 internal_record->entry_type );
  327|  4.34k|	}
  328|       |#if defined( HAVE_DEBUG_OUTPUT )
  329|       |	if( libcnotify_verbose != 0 )
  330|       |	{
  331|       |		libcnotify_printf(
  332|       |		 "%s: size\t\t\t\t: %" PRIu32 "\n",
  333|       |		 function,
  334|       |		 internal_record->size );
  335|       |
  336|       |		if( internal_record->type == LIBFWPS_RECORD_TYPE_NAMED )
  337|       |		{
  338|       |			libcnotify_printf(
  339|       |			 "%s: name size\t\t\t\t: %" PRIu32 "\n",
  340|       |			 function,
  341|       |			 name_size );
  342|       |		}
  343|       |		else
  344|       |		{
  345|       |			libcnotify_printf(
  346|       |			 "%s: entry type\t\t\t: %" PRIu32 "\n",
  347|       |			 function,
  348|       |			 internal_record->entry_type );
  349|       |		}
  350|       |		libcnotify_printf(
  351|       |		 "%s: unknown1\t\t\t\t: 0x%02" PRIx8 "\n",
  352|       |		 function,
  353|       |		 byte_stream[ byte_stream_offset + 8 ] );
  354|       |	}
  355|       |#endif /* defined( HAVE_DEBUG_OUTPUT ) */
  356|       |
  357|  6.31k|	byte_stream_offset += 9;
  358|       |
  359|  6.31k|	if( internal_record->type == LIBFWPS_RECORD_TYPE_NAMED )
  ------------------
  |  Branch (359:6): [True: 1.96k, False: 4.34k]
  ------------------
  360|  1.96k|	{
  361|  1.96k|		if( ( name_size > byte_stream_size )
  ------------------
  |  Branch (361:7): [True: 43, False: 1.92k]
  ------------------
  362|  1.96k|		 || ( byte_stream_offset > ( byte_stream_size - name_size ) ) )
  ------------------
  |  Branch (362:7): [True: 5, False: 1.91k]
  ------------------
  363|     48|		{
  364|     48|			libcerror_error_set(
  365|     48|			 error,
  366|     48|			 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  367|     48|			 LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS,
  368|     48|			 "%s: invalid name size value out of bounds.",
  369|     48|			 function );
  370|       |
  371|     48|			goto on_error;
  372|     48|		}
  373|  1.91k|		internal_record->entry_name = (uint8_t *) memory_allocate(
  ------------------
  |  |   60|  1.91k|	malloc( size )
  ------------------
  374|  1.91k|		                                           sizeof( uint8_t ) * name_size );
  375|       |
  376|  1.91k|		if( internal_record->entry_name == NULL )
  ------------------
  |  Branch (376:7): [True: 0, False: 1.91k]
  ------------------
  377|      0|		{
  378|      0|			libcerror_error_set(
  379|      0|			 error,
  380|      0|			 LIBCERROR_ERROR_DOMAIN_MEMORY,
  381|      0|			 LIBCERROR_MEMORY_ERROR_INSUFFICIENT,
  382|      0|			 "%s: unable to create entry name.",
  383|      0|			 function );
  384|       |
  385|      0|			goto on_error;
  386|      0|		}
  387|  1.91k|		if( memory_copy(
  ------------------
  |  |  114|  1.91k|	memcpy( (void *) destination, (void *) source, count )
  ------------------
  |  Branch (387:7): [True: 0, False: 1.91k]
  ------------------
  388|  1.91k|		     internal_record->entry_name,
  389|  1.91k|		     &( byte_stream[ byte_stream_offset ] ),
  390|  1.91k|		     name_size ) == NULL )
  391|      0|		{
  392|      0|			libcerror_error_set(
  393|      0|			 error,
  394|      0|			 LIBCERROR_ERROR_DOMAIN_MEMORY,
  395|      0|			 LIBCERROR_MEMORY_ERROR_COPY_FAILED,
  396|      0|			 "%s: unable to copy entry name data.",
  397|      0|			 function );
  398|       |
  399|      0|			goto on_error;
  400|      0|		}
  401|  1.91k|		internal_record->entry_name_size = name_size;
  402|       |
  403|       |#if defined( HAVE_DEBUG_OUTPUT )
  404|       |		if( libcnotify_verbose != 0 )
  405|       |		{
  406|       |			if( libfwps_debug_print_utf16_string_value(
  407|       |			     function,
  408|       |			     "entry name\t\t\t",
  409|       |			     internal_record->entry_name,
  410|       |			     internal_record->entry_name_size,
  411|       |			     LIBUNA_ENDIAN_LITTLE,
  412|       |			     error ) != 1 )
  413|       |			{
  414|       |				libcerror_error_set(
  415|       |				 error,
  416|       |				 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  417|       |				 LIBCERROR_RUNTIME_ERROR_PRINT_FAILED,
  418|       |				 "%s: unable to print UTF-16 string value.",
  419|       |				 function );
  420|       |
  421|       |				goto on_error;
  422|       |			}
  423|       |		}
  424|       |#endif /* defined( HAVE_DEBUG_OUTPUT ) */
  425|       |
  426|  1.91k|		byte_stream_offset += name_size;
  427|  1.91k|	}
  428|  6.26k|	if( byte_stream_offset > ( byte_stream_size - 4 ) )
  ------------------
  |  Branch (428:6): [True: 7, False: 6.26k]
  ------------------
  429|      7|	{
  430|      7|		libcerror_error_set(
  431|      7|		 error,
  432|      7|		 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
  433|      7|		 LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL,
  434|      7|		 "%s: invalid byte stream size value too small.",
  435|      7|		 function );
  436|       |
  437|      7|		goto on_error;
  438|      7|	}
  439|  6.26k|	byte_stream_copy_to_uint32_little_endian(
  ------------------
  |  |   88|  6.26k|	( value )   = ( byte_stream )[ 3 ]; \
  |  |   89|  6.26k|	( value ) <<= 8; \
  |  |   90|  6.26k|	( value )  |= ( byte_stream )[ 2 ]; \
  |  |   91|  6.26k|	( value ) <<= 8; \
  |  |   92|  6.26k|	( value )  |= ( byte_stream )[ 1 ]; \
  |  |   93|  6.26k|	( value ) <<= 8; \
  |  |   94|  6.26k|	( value )  |= ( byte_stream )[ 0 ];
  ------------------
  440|  6.26k|	 &( byte_stream[ byte_stream_offset ] ),
  441|  6.26k|	 internal_record->value_type );
  442|       |
  443|  6.26k|	byte_stream_offset += 4;
  444|       |
  445|       |#if defined( HAVE_DEBUG_OUTPUT )
  446|       |	if( libcnotify_verbose != 0 )
  447|       |	{
  448|       |		libcnotify_printf(
  449|       |		 "%s: value type\t\t\t: %" PRIu32 "\n",
  450|       |		 function,
  451|       |		 internal_record->value_type );
  452|       |	}
  453|       |#endif
  454|  6.26k|	switch( internal_record->value_type )
  455|  6.26k|	{
  456|    905|		case LIBFWPS_VALUE_TYPE_BOOLEAN:
  ------------------
  |  Branch (456:3): [True: 905, False: 5.35k]
  ------------------
  457|  1.51k|		case LIBFWPS_VALUE_TYPE_INTEGER_8BIT_SIGNED:
  ------------------
  |  Branch (457:3): [True: 609, False: 5.65k]
  ------------------
  458|  2.04k|		case LIBFWPS_VALUE_TYPE_INTEGER_8BIT_UNSIGNED:
  ------------------
  |  Branch (458:3): [True: 531, False: 5.72k]
  ------------------
  459|  2.04k|			internal_record->value_data_size = 1;
  460|  2.04k|			break;
  461|       |
  462|    986|		case LIBFWPS_VALUE_TYPE_INTEGER_16BIT_SIGNED:
  ------------------
  |  Branch (462:3): [True: 986, False: 5.27k]
  ------------------
  463|  1.39k|		case LIBFWPS_VALUE_TYPE_INTEGER_16BIT_UNSIGNED:
  ------------------
  |  Branch (463:3): [True: 408, False: 5.85k]
  ------------------
  464|  1.39k|			internal_record->value_data_size = 2;
  465|  1.39k|			break;
  466|       |
  467|    201|		case LIBFWPS_VALUE_TYPE_FLOAT_32BIT:
  ------------------
  |  Branch (467:3): [True: 201, False: 6.05k]
  ------------------
  468|    414|		case LIBFWPS_VALUE_TYPE_INTEGER_32BIT_SIGNED:
  ------------------
  |  Branch (468:3): [True: 213, False: 6.04k]
  ------------------
  469|    610|		case LIBFWPS_VALUE_TYPE_INTEGER_32BIT_UNSIGNED:
  ------------------
  |  Branch (469:3): [True: 196, False: 6.06k]
  ------------------
  470|    610|			internal_record->value_data_size = 4;
  471|    610|			break;
  472|       |
  473|    201|		case LIBFWPS_VALUE_TYPE_CURRENCY:
  ------------------
  |  Branch (473:3): [True: 201, False: 6.05k]
  ------------------
  474|    406|		case LIBFWPS_VALUE_TYPE_DOUBLE_64BIT:
  ------------------
  |  Branch (474:3): [True: 205, False: 6.05k]
  ------------------
  475|    603|		case LIBFWPS_VALUE_TYPE_FILETIME:
  ------------------
  |  Branch (475:3): [True: 197, False: 6.06k]
  ------------------
  476|    798|		case LIBFWPS_VALUE_TYPE_INTEGER_64BIT_SIGNED:
  ------------------
  |  Branch (476:3): [True: 195, False: 6.06k]
  ------------------
  477|  1.02k|		case LIBFWPS_VALUE_TYPE_INTEGER_64BIT_UNSIGNED:
  ------------------
  |  Branch (477:3): [True: 228, False: 6.03k]
  ------------------
  478|  1.02k|			internal_record->value_data_size = 8;
  479|  1.02k|			break;
  480|       |
  481|    199|		case LIBFWPS_VALUE_TYPE_FIXED_POINT_128BIT:
  ------------------
  |  Branch (481:3): [True: 199, False: 6.06k]
  ------------------
  482|    394|		case LIBFWPS_VALUE_TYPE_GUID:
  ------------------
  |  Branch (482:3): [True: 195, False: 6.06k]
  ------------------
  483|    394|			internal_record->value_data_size = 16;
  484|    394|			break;
  485|       |
  486|    241|		case LIBFWPS_VALUE_TYPE_BINARY_STRING:
  ------------------
  |  Branch (486:3): [True: 241, False: 6.01k]
  ------------------
  487|    241|		case LIBFWPS_VALUE_TYPE_STREAM:
  ------------------
  |  Branch (487:3): [True: 0, False: 6.26k]
  ------------------
  488|    514|		case LIBFWPS_VALUE_TYPE_STRING_ASCII:
  ------------------
  |  Branch (488:3): [True: 273, False: 5.98k]
  ------------------
  489|    750|		case LIBFWPS_VALUE_TYPE_STRING_UNICODE:
  ------------------
  |  Branch (489:3): [True: 236, False: 6.02k]
  ------------------
  490|    750|			internal_record->value_data_size = 0;
  491|    750|			break;
  492|       |
  493|     41|		default:
  ------------------
  |  Branch (493:3): [True: 41, False: 6.21k]
  ------------------
  494|     41|			libcerror_error_set(
  495|     41|			 error,
  496|     41|			 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  497|     41|			 LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE,
  498|     41|			 "%s: invalid record entry - unsupported value type.",
  499|     41|			 function );
  500|       |
  501|     41|			goto on_error;
  502|  6.26k|	}
  503|  6.21k|	if( internal_record->value_type == LIBFWPS_VALUE_TYPE_STREAM )
  ------------------
  |  Branch (503:6): [True: 0, False: 6.21k]
  ------------------
  504|      0|	{
  505|      0|		if( byte_stream_offset > ( byte_stream_size - 4 ) )
  ------------------
  |  Branch (505:7): [True: 0, False: 0]
  ------------------
  506|      0|		{
  507|      0|			libcerror_error_set(
  508|      0|			 error,
  509|      0|			 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
  510|      0|			 LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL,
  511|      0|			 "%s: invalid byte stream size value too small.",
  512|      0|			 function );
  513|       |
  514|      0|			goto on_error;
  515|      0|		}
  516|      0|		byte_stream_copy_to_uint32_little_endian(
  ------------------
  |  |   88|      0|	( value )   = ( byte_stream )[ 3 ]; \
  |  |   89|      0|	( value ) <<= 8; \
  |  |   90|      0|	( value )  |= ( byte_stream )[ 2 ]; \
  |  |   91|      0|	( value ) <<= 8; \
  |  |   92|      0|	( value )  |= ( byte_stream )[ 1 ]; \
  |  |   93|      0|	( value ) <<= 8; \
  |  |   94|      0|	( value )  |= ( byte_stream )[ 0 ];
  ------------------
  517|      0|		 &( byte_stream[ byte_stream_offset ] ),
  518|      0|		 name_size );
  519|       |
  520|      0|		byte_stream_offset += 4;
  521|       |
  522|      0|		if( ( name_size > byte_stream_size )
  ------------------
  |  Branch (522:7): [True: 0, False: 0]
  ------------------
  523|      0|		 || ( byte_stream_offset > ( byte_stream_size - name_size ) ) )
  ------------------
  |  Branch (523:7): [True: 0, False: 0]
  ------------------
  524|      0|		{
  525|      0|			libcerror_error_set(
  526|      0|			 error,
  527|      0|			 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  528|      0|			 LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS,
  529|      0|			 "%s: invalid name size value out of bounds.",
  530|      0|			 function );
  531|       |
  532|      0|			goto on_error;
  533|      0|		}
  534|      0|		internal_record->value_name = (uint8_t *) memory_allocate(
  ------------------
  |  |   60|      0|	malloc( size )
  ------------------
  535|      0|		                                           sizeof( uint8_t ) * name_size );
  536|       |
  537|      0|		if( internal_record->value_name == NULL )
  ------------------
  |  Branch (537:7): [True: 0, False: 0]
  ------------------
  538|      0|		{
  539|      0|			libcerror_error_set(
  540|      0|			 error,
  541|      0|			 LIBCERROR_ERROR_DOMAIN_MEMORY,
  542|      0|			 LIBCERROR_MEMORY_ERROR_INSUFFICIENT,
  543|      0|			 "%s: unable to create value name.",
  544|      0|			 function );
  545|       |
  546|      0|			goto on_error;
  547|      0|		}
  548|      0|		if( memory_copy(
  ------------------
  |  |  114|      0|	memcpy( (void *) destination, (void *) source, count )
  ------------------
  |  Branch (548:7): [True: 0, False: 0]
  ------------------
  549|      0|		     internal_record->value_name,
  550|      0|		     &( byte_stream[ byte_stream_offset ] ),
  551|      0|		     name_size ) == NULL )
  552|      0|		{
  553|      0|			libcerror_error_set(
  554|      0|			 error,
  555|      0|			 LIBCERROR_ERROR_DOMAIN_MEMORY,
  556|      0|			 LIBCERROR_MEMORY_ERROR_COPY_FAILED,
  557|      0|			 "%s: unable to copy value name data.",
  558|      0|			 function );
  559|       |
  560|      0|			goto on_error;
  561|      0|		}
  562|      0|		internal_record->value_name_size = name_size;
  563|       |
  564|       |#if defined( HAVE_DEBUG_OUTPUT )
  565|       |		if( libcnotify_verbose != 0 )
  566|       |		{
  567|       |			if( libfwps_debug_print_utf16_string_value(
  568|       |			     function,
  569|       |			     "value name\t\t\t",
  570|       |			     internal_record->value_name,
  571|       |			     internal_record->value_name_size,
  572|       |			     LIBUNA_ENDIAN_LITTLE,
  573|       |			     error ) != 1 )
  574|       |			{
  575|       |				libcerror_error_set(
  576|       |				 error,
  577|       |				 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  578|       |				 LIBCERROR_RUNTIME_ERROR_PRINT_FAILED,
  579|       |				 "%s: unable to print UTF-16 string value.",
  580|       |				 function );
  581|       |
  582|       |				goto on_error;
  583|       |			}
  584|       |		}
  585|       |#endif /* defined( HAVE_DEBUG_OUTPUT ) */
  586|       |
  587|      0|		byte_stream_offset += name_size;
  588|       |
  589|      0|		if( byte_stream_offset > ( byte_stream_size - 2 ) )
  ------------------
  |  Branch (589:7): [True: 0, False: 0]
  ------------------
  590|      0|		{
  591|      0|			libcerror_error_set(
  592|      0|			 error,
  593|      0|			 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
  594|      0|			 LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL,
  595|      0|			 "%s: invalid byte stream size value too small.",
  596|      0|			 function );
  597|       |
  598|      0|			goto on_error;
  599|      0|		}
  600|       |#if defined( HAVE_DEBUG_OUTPUT )
  601|       |		if( libcnotify_verbose != 0 )
  602|       |		{
  603|       |			byte_stream_copy_to_uint16_little_endian(
  604|       |			 &( byte_stream[ byte_stream_offset ] ),
  605|       |			 value_16bit );
  606|       |			libcnotify_printf(
  607|       |			 "%s: unknown1\t\t\t\t: 0x%04" PRIx16 "\n",
  608|       |			 function,
  609|       |			 value_16bit );
  610|       |		}
  611|       |#endif
  612|      0|		byte_stream_offset += 2;
  613|      0|	}
  614|  6.21k|	if( internal_record->value_data_size == 0 )
  ------------------
  |  Branch (614:6): [True: 750, False: 5.46k]
  ------------------
  615|    750|	{
  616|    750|		if( byte_stream_offset > ( byte_stream_size - 4 ) )
  ------------------
  |  Branch (616:7): [True: 10, False: 740]
  ------------------
  617|     10|		{
  618|     10|			libcerror_error_set(
  619|     10|			 error,
  620|     10|			 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
  621|     10|			 LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL,
  622|     10|			 "%s: invalid byte stream size value too small.",
  623|     10|			 function );
  624|       |
  625|     10|			goto on_error;
  626|     10|		}
  627|    740|		byte_stream_copy_to_uint32_little_endian(
  ------------------
  |  |   88|    740|	( value )   = ( byte_stream )[ 3 ]; \
  |  |   89|    740|	( value ) <<= 8; \
  |  |   90|    740|	( value )  |= ( byte_stream )[ 2 ]; \
  |  |   91|    740|	( value ) <<= 8; \
  |  |   92|    740|	( value )  |= ( byte_stream )[ 1 ]; \
  |  |   93|    740|	( value ) <<= 8; \
  |  |   94|    740|	( value )  |= ( byte_stream )[ 0 ];
  ------------------
  628|    740|		 &( byte_stream[ byte_stream_offset ] ),
  629|    740|		 internal_record->value_data_size );
  630|       |
  631|    740|		byte_stream_offset += 4;
  632|       |
  633|    740|		if( internal_record->value_type == LIBFWPS_VALUE_TYPE_STRING_UNICODE )
  ------------------
  |  Branch (633:7): [True: 231, False: 509]
  ------------------
  634|    231|		{
  635|    231|			internal_record->value_data_size *= 2;
  636|    231|		}
  637|    740|	}
  638|       |#if defined( HAVE_DEBUG_OUTPUT )
  639|       |	if( libcnotify_verbose != 0 )
  640|       |	{
  641|       |		libcnotify_printf(
  642|       |		 "%s: value data size\t\t\t: %" PRIu32 "\n",
  643|       |		 function,
  644|       |		 internal_record->value_data_size );
  645|       |	}
  646|       |#endif
  647|  6.20k|	if( internal_record->value_data_size > 0 )
  ------------------
  |  Branch (647:6): [True: 5.60k, False: 601]
  ------------------
  648|  5.60k|	{
  649|  5.60k|		if( ( internal_record->value_data_size > byte_stream_size )
  ------------------
  |  Branch (649:7): [True: 72, False: 5.53k]
  ------------------
  650|  5.60k|		 || ( byte_stream_offset > ( byte_stream_size - internal_record->value_data_size ) ) )
  ------------------
  |  Branch (650:7): [True: 52, False: 5.48k]
  ------------------
  651|    124|		{
  652|    124|			libcerror_error_set(
  653|    124|			 error,
  654|    124|			 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  655|    124|			 LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS,
  656|    124|			 "%s: invalid valud data size value out of bounds.",
  657|    124|			 function );
  658|       |
  659|    124|			goto on_error;
  660|    124|		}
  661|       |#if defined( HAVE_DEBUG_OUTPUT )
  662|       |		if( libcnotify_verbose != 0 )
  663|       |		{
  664|       |			libcnotify_printf(
  665|       |			 "%s: value data:\n",
  666|       |			 function );
  667|       |			libcnotify_print_data(
  668|       |			 &( byte_stream[ byte_stream_offset ] ),
  669|       |			 internal_record->value_data_size,
  670|       |			 LIBCNOTIFY_PRINT_DATA_FLAG_GROUP_DATA );
  671|       |		}
  672|       |#endif
  673|  5.48k|		if( internal_record->value_data_size > MEMORY_MAXIMUM_ALLOCATION_SIZE )
  ------------------
  |  |   46|  5.48k|	( 128 * 1024 * 1024 )
  ------------------
  |  Branch (673:7): [True: 0, False: 5.48k]
  ------------------
  674|      0|		{
  675|      0|			libcerror_error_set(
  676|      0|			 error,
  677|      0|			 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  678|      0|			 LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM,
  679|      0|			 "%s: invalid value data size value exceeds maximum.",
  680|      0|			 function );
  681|       |
  682|      0|			goto on_error;
  683|      0|		}
  684|  5.48k|		internal_record->value_data = (uint8_t *) memory_allocate(
  ------------------
  |  |   60|  5.48k|	malloc( size )
  ------------------
  685|  5.48k|		                                           sizeof( uint8_t ) * internal_record->value_data_size );
  686|       |
  687|  5.48k|		if( internal_record->value_data == NULL )
  ------------------
  |  Branch (687:7): [True: 0, False: 5.48k]
  ------------------
  688|      0|		{
  689|      0|			libcerror_error_set(
  690|      0|			 error,
  691|      0|			 LIBCERROR_ERROR_DOMAIN_MEMORY,
  692|      0|			 LIBCERROR_MEMORY_ERROR_INSUFFICIENT,
  693|      0|			 "%s: unable to create value data.",
  694|      0|			 function );
  695|       |
  696|      0|			goto on_error;
  697|      0|		}
  698|  5.48k|		if( memory_copy(
  ------------------
  |  |  114|  5.48k|	memcpy( (void *) destination, (void *) source, count )
  ------------------
  |  Branch (698:7): [True: 0, False: 5.48k]
  ------------------
  699|  5.48k|		     internal_record->value_data,
  700|  5.48k|		     &( byte_stream[ byte_stream_offset ] ),
  701|  5.48k|		     internal_record->value_data_size ) == NULL )
  702|      0|		{
  703|      0|			libcerror_error_set(
  704|      0|			 error,
  705|      0|			 LIBCERROR_ERROR_DOMAIN_MEMORY,
  706|      0|			 LIBCERROR_MEMORY_ERROR_COPY_FAILED,
  707|      0|			 "%s: unable to copy value data.",
  708|      0|			 function );
  709|       |
  710|      0|			goto on_error;
  711|      0|		}
  712|  5.48k|		byte_stream_offset += internal_record->value_data_size;
  713|  5.48k|	}
  714|       |#if defined( HAVE_DEBUG_OUTPUT )
  715|       |	if( libcnotify_verbose != 0 )
  716|       |	{
  717|       |		if( byte_stream_offset < internal_record->size )
  718|       |		{
  719|       |			libcnotify_printf(
  720|       |			 "%s: trailing data:\n",
  721|       |			 function );
  722|       |			libcnotify_print_data(
  723|       |			 &( byte_stream[ byte_stream_offset ] ),
  724|       |			 internal_record->size - byte_stream_offset,
  725|       |			 LIBCNOTIFY_PRINT_DATA_FLAG_GROUP_DATA );
  726|       |		}
  727|       |	}
  728|       |#endif
  729|  6.08k|	internal_record->ascii_codepage = ascii_codepage;
  730|       |
  731|  6.08k|	return( 1 );
  732|       |
  733|    230|on_error:
  734|       |#if defined( HAVE_DEBUG_OUTPUT )
  735|       |	if( value_string != NULL )
  736|       |	{
  737|       |		memory_free(
  738|       |		 value_string );
  739|       |	}
  740|       |#endif
  741|    230|	if( internal_record->value_data != NULL )
  ------------------
  |  Branch (741:6): [True: 0, False: 230]
  ------------------
  742|      0|	{
  743|      0|		memory_free(
  ------------------
  |  |  100|      0|	free( (void *) buffer )
  ------------------
  744|      0|		 internal_record->value_data );
  745|       |
  746|      0|		internal_record->value_data = NULL;
  747|      0|	}
  748|    230|	internal_record->value_data_size = 0;
  749|       |
  750|    230|	if( internal_record->value_name != NULL )
  ------------------
  |  Branch (750:6): [True: 0, False: 230]
  ------------------
  751|      0|	{
  752|      0|		memory_free(
  ------------------
  |  |  100|      0|	free( (void *) buffer )
  ------------------
  753|      0|		 internal_record->value_name );
  754|       |
  755|      0|		internal_record->value_name = NULL;
  756|      0|	}
  757|    230|	internal_record->value_name_size = 0;
  758|       |
  759|    230|	if( internal_record->entry_name != NULL )
  ------------------
  |  Branch (759:6): [True: 45, False: 185]
  ------------------
  760|     45|	{
  761|     45|		memory_free(
  ------------------
  |  |  100|     45|	free( (void *) buffer )
  ------------------
  762|     45|		 internal_record->entry_name );
  763|       |
  764|     45|		internal_record->entry_name = NULL;
  765|     45|	}
  766|    230|	internal_record->entry_name_size = 0;
  767|       |
  768|    230|	return( -1 );
  769|  6.20k|}

libfwps_set_initialize:
   51|   347k|{
   52|   347k|	libfwps_internal_set_t *internal_set = NULL;
   53|   347k|	static char *function                = "libfwps_set_initialize";
   54|       |
   55|   347k|	if( set == NULL )
  ------------------
  |  Branch (55:6): [True: 0, False: 347k]
  ------------------
   56|      0|	{
   57|      0|		libcerror_error_set(
   58|      0|		 error,
   59|      0|		 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
   60|      0|		 LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE,
   61|      0|		 "%s: invalid set.",
   62|      0|		 function );
   63|       |
   64|      0|		return( -1 );
   65|      0|	}
   66|   347k|	if( *set != NULL )
  ------------------
  |  Branch (66:6): [True: 0, False: 347k]
  ------------------
   67|      0|	{
   68|      0|		libcerror_error_set(
   69|      0|		 error,
   70|      0|		 LIBCERROR_ERROR_DOMAIN_RUNTIME,
   71|      0|		 LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET,
   72|      0|		 "%s: invalid set value already set.",
   73|      0|		 function );
   74|       |
   75|      0|		return( -1 );
   76|      0|	}
   77|   347k|	internal_set = memory_allocate_structure(
  ------------------
  |  |   64|   347k|	(type *) memory_allocate( sizeof( type ) )
  |  |  ------------------
  |  |  |  |   60|   347k|	malloc( size )
  |  |  ------------------
  ------------------
   78|   347k|	                libfwps_internal_set_t );
   79|       |
   80|   347k|	if( internal_set == NULL )
  ------------------
  |  Branch (80:6): [True: 0, False: 347k]
  ------------------
   81|      0|	{
   82|      0|		libcerror_error_set(
   83|      0|		 error,
   84|      0|		 LIBCERROR_ERROR_DOMAIN_MEMORY,
   85|      0|		 LIBCERROR_MEMORY_ERROR_INSUFFICIENT,
   86|      0|		 "%s: unable to create set.",
   87|      0|		 function );
   88|       |
   89|      0|		goto on_error;
   90|      0|	}
   91|   347k|	if( memory_set(
  ------------------
  |  |  121|   347k|	memset( (void *) buffer, (int) value, count )
  ------------------
  |  Branch (91:6): [True: 0, False: 347k]
  ------------------
   92|   347k|	     internal_set,
   93|   347k|	     0,
   94|   347k|	     sizeof( libfwps_internal_set_t ) ) == NULL )
   95|      0|	{
   96|      0|		libcerror_error_set(
   97|      0|		 error,
   98|      0|		 LIBCERROR_ERROR_DOMAIN_MEMORY,
   99|      0|		 LIBCERROR_MEMORY_ERROR_SET_FAILED,
  100|      0|		 "%s: unable to clear set.",
  101|      0|		 function );
  102|       |
  103|      0|		memory_free(
  ------------------
  |  |  100|      0|	free( (void *) buffer )
  ------------------
  104|      0|		 internal_set );
  105|       |
  106|      0|		return( -1 );
  107|      0|	}
  108|   347k|	if( libcdata_array_initialize(
  ------------------
  |  Branch (108:6): [True: 0, False: 347k]
  ------------------
  109|   347k|	     &( internal_set->records_array ),
  110|   347k|	     0,
  111|   347k|	     error ) != 1 )
  112|      0|	{
  113|      0|		libcerror_error_set(
  114|      0|		 error,
  115|      0|		 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  116|      0|		 LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED,
  117|      0|		 "%s: unable to create records array.",
  118|      0|		 function );
  119|       |
  120|      0|		goto on_error;
  121|      0|	}
  122|   347k|	*set = (libfwps_set_t *) internal_set;
  123|       |
  124|   347k|	return( 1 );
  125|       |
  126|      0|on_error:
  127|      0|	if( internal_set != NULL )
  ------------------
  |  Branch (127:6): [True: 0, False: 0]
  ------------------
  128|      0|	{
  129|      0|		memory_free(
  ------------------
  |  |  100|      0|	free( (void *) buffer )
  ------------------
  130|      0|		 internal_set );
  131|      0|	}
  132|      0|	return( -1 );
  133|   347k|}
libfwps_internal_set_free:
  188|   347k|{
  189|   347k|	static char *function = "libfwps_internal_set_free";
  190|   347k|	int result            = 1;
  191|       |
  192|   347k|	if( internal_set == NULL )
  ------------------
  |  Branch (192:6): [True: 0, False: 347k]
  ------------------
  193|      0|	{
  194|      0|		libcerror_error_set(
  195|      0|		 error,
  196|      0|		 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
  197|      0|		 LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE,
  198|      0|		 "%s: invalid set.",
  199|      0|		 function );
  200|       |
  201|      0|		return( -1 );
  202|      0|	}
  203|   347k|	if( *internal_set != NULL )
  ------------------
  |  Branch (203:6): [True: 347k, False: 0]
  ------------------
  204|   347k|	{
  205|   347k|		if( libcdata_array_free(
  ------------------
  |  Branch (205:7): [True: 0, False: 347k]
  ------------------
  206|   347k|		     &( ( *internal_set )->records_array ),
  207|   347k|		     (int(*)(intptr_t **, libcerror_error_t **)) &libfwps_internal_record_free,
  208|   347k|		     error ) != 1 )
  209|      0|		{
  210|      0|			libcerror_error_set(
  211|      0|			 error,
  212|      0|			 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  213|      0|			 LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED,
  214|      0|			 "%s: unable to free records array.",
  215|      0|			 function );
  216|       |
  217|      0|			result = -1;
  218|      0|		}
  219|   347k|		memory_free(
  ------------------
  |  |  100|   347k|	free( (void *) buffer )
  ------------------
  220|   347k|		 *internal_set );
  221|       |
  222|   347k|		*internal_set = NULL;
  223|   347k|	}
  224|   347k|	return( result );
  225|   347k|}
libfwps_set_copy_from_byte_stream:
  236|   347k|{
  237|   347k|	libfwps_internal_set_t *internal_set = NULL;
  238|   347k|	libfwps_record_t *property_record    = NULL;
  239|   347k|	static char *function                = "libfwps_set_copy_from_byte_stream";
  240|   347k|	size_t byte_stream_offset            = 0;
  241|   347k|	uint32_t record_data_size            = 0;
  242|   347k|	uint8_t property_record_type         = 0;
  243|   347k|	int entry_index                      = 0;
  244|   347k|	int record_index                     = 0;
  245|       |
  246|       |#if defined( HAVE_DEBUG_OUTPUT )
  247|       |        system_character_t guid_string[ 48 ];
  248|       |
  249|       |        libfguid_identifier_t *guid          = NULL;
  250|       |	int result                           = 0;
  251|       |#endif
  252|       |
  253|   347k|	if( set == NULL )
  ------------------
  |  Branch (253:6): [True: 0, False: 347k]
  ------------------
  254|      0|	{
  255|      0|		libcerror_error_set(
  256|      0|		 error,
  257|      0|		 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
  258|      0|		 LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE,
  259|      0|		 "%s: invalid set.",
  260|      0|		 function );
  261|       |
  262|      0|		return( -1 );
  263|      0|	}
  264|   347k|	internal_set = (libfwps_internal_set_t *) set;
  265|       |
  266|   347k|	if( byte_stream == NULL )
  ------------------
  |  Branch (266:6): [True: 0, False: 347k]
  ------------------
  267|      0|	{
  268|      0|		libcerror_error_set(
  269|      0|		 error,
  270|      0|		 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
  271|      0|		 LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE,
  272|      0|		 "%s: invalid byte stream.",
  273|      0|		 function );
  274|       |
  275|      0|		return( -1 );
  276|      0|	}
  277|   347k|	if( ( byte_stream_size < 24 )
  ------------------
  |  Branch (277:6): [True: 28, False: 347k]
  ------------------
  278|   347k|	 || ( byte_stream_size > (size_t) SSIZE_MAX ) )
  ------------------
  |  Branch (278:6): [True: 0, False: 347k]
  ------------------
  279|     28|	{
  280|     28|		libcerror_error_set(
  281|     28|		 error,
  282|     28|		 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
  283|     28|		 LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS,
  284|     28|		 "%s: invalid byte stream size value out of bounds.",
  285|     28|		 function );
  286|       |
  287|     28|		return( -1 );
  288|     28|	}
  289|       |#if defined( HAVE_DEBUG_OUTPUT )
  290|       |	if( libcnotify_verbose != 0 )
  291|       |	{
  292|       |		libcnotify_printf(
  293|       |		 "%s: property set data:\n",
  294|       |		 function );
  295|       |		libcnotify_print_data(
  296|       |		 byte_stream,
  297|       |		 24,
  298|       |		 0 );
  299|       |	}
  300|       |#endif
  301|   347k|	if( memory_compare(
  ------------------
  |  |  107|   347k|	memcmp( (const void *) buffer1, (const void *) buffer2, size )
  ------------------
  |  Branch (301:6): [True: 38, False: 347k]
  ------------------
  302|   347k|	     &( byte_stream[ byte_stream_offset + 4 ] ),
  303|   347k|	     libfwps_serialized_property_set_signature,
  304|   347k|	     4 ) != 0 )
  305|     38|	{
  306|     38|		libcerror_error_set(
  307|     38|		 error,
  308|     38|		 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  309|     38|		 LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE,
  310|     38|		 "%s: unsupported signature.",
  311|     38|		 function );
  312|       |
  313|     38|		goto on_error;
  314|     38|	}
  315|   347k|	byte_stream_copy_to_uint32_little_endian(
  ------------------
  |  |   88|   347k|	( value )   = ( byte_stream )[ 3 ]; \
  |  |   89|   347k|	( value ) <<= 8; \
  |  |   90|   347k|	( value )  |= ( byte_stream )[ 2 ]; \
  |  |   91|   347k|	( value ) <<= 8; \
  |  |   92|   347k|	( value )  |= ( byte_stream )[ 1 ]; \
  |  |   93|   347k|	( value ) <<= 8; \
  |  |   94|   347k|	( value )  |= ( byte_stream )[ 0 ];
  ------------------
  316|   347k|	 byte_stream,
  317|   347k|	 internal_set->size );
  318|       |
  319|   347k|	if( memory_copy(
  ------------------
  |  |  114|   347k|	memcpy( (void *) destination, (void *) source, count )
  ------------------
  |  Branch (319:6): [True: 0, False: 347k]
  ------------------
  320|   347k|	     internal_set->identifier,
  321|   347k|	     &( byte_stream[ byte_stream_offset + 8 ] ),
  322|   347k|	     16 ) == NULL )
  323|      0|	{
  324|      0|		libcerror_error_set(
  325|      0|		 error,
  326|      0|		 LIBCERROR_ERROR_DOMAIN_MEMORY,
  327|      0|		 LIBCERROR_MEMORY_ERROR_COPY_FAILED,
  328|      0|		 "%s: unable to copy identifier.",
  329|      0|		 function );
  330|       |
  331|      0|		goto on_error;
  332|      0|	}
  333|       |#if defined( HAVE_DEBUG_OUTPUT )
  334|       |	if( libcnotify_verbose != 0 )
  335|       |	{
  336|       |		libcnotify_printf(
  337|       |		 "%s: size\t\t\t\t\t: %" PRIu16 "\n",
  338|       |		 function,
  339|       |		 internal_set->size );
  340|       |
  341|       |		libcnotify_printf(
  342|       |		 "%s: signature\t\t\t\t: %c%c%c%c\n",
  343|       |		 function,
  344|       |		 byte_stream[ byte_stream_offset + 4 ],
  345|       |		 byte_stream[ byte_stream_offset + 5 ],
  346|       |		 byte_stream[ byte_stream_offset + 6 ],
  347|       |		 byte_stream[ byte_stream_offset + 7 ] );
  348|       |
  349|       |		if( libfguid_identifier_initialize(
  350|       |		     &guid,
  351|       |		     error ) != 1 )
  352|       |		{
  353|       |			libcerror_error_set(
  354|       |			 error,
  355|       |			 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  356|       |			 LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED,
  357|       |			 "%s: unable to create GUID.",
  358|       |			 function );
  359|       |
  360|       |			goto on_error;
  361|       |		}
  362|       |		if( libfguid_identifier_copy_from_byte_stream(
  363|       |		     guid,
  364|       |		     internal_set->identifier,
  365|       |		     16,
  366|       |		     LIBFGUID_ENDIAN_LITTLE,
  367|       |		     error ) != 1 )
  368|       |		{
  369|       |			libcerror_error_set(
  370|       |			 error,
  371|       |			 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  372|       |			 LIBCERROR_RUNTIME_ERROR_COPY_FAILED,
  373|       |			 "%s: unable to copy byte stream to GUID.",
  374|       |			 function );
  375|       |
  376|       |			goto on_error;
  377|       |		}
  378|       |#if defined( HAVE_WIDE_SYSTEM_CHARACTER )
  379|       |		result = libfguid_identifier_copy_to_utf16_string(
  380|       |			  guid,
  381|       |			  (uint16_t *) guid_string,
  382|       |			  48,
  383|       |			  LIBFGUID_STRING_FORMAT_FLAG_USE_UPPER_CASE | LIBFGUID_STRING_FORMAT_FLAG_USE_SURROUNDING_BRACES,
  384|       |			  error );
  385|       |#else
  386|       |		result = libfguid_identifier_copy_to_utf8_string(
  387|       |			  guid,
  388|       |			  (uint8_t *) guid_string,
  389|       |			  48,
  390|       |			  LIBFGUID_STRING_FORMAT_FLAG_USE_UPPER_CASE | LIBFGUID_STRING_FORMAT_FLAG_USE_SURROUNDING_BRACES,
  391|       |			  error );
  392|       |#endif
  393|       |		if( result != 1 )
  394|       |		{
  395|       |			libcerror_error_set(
  396|       |			 error,
  397|       |			 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  398|       |			 LIBCERROR_RUNTIME_ERROR_COPY_FAILED,
  399|       |			 "%s: unable to copy GUID to string.",
  400|       |			 function );
  401|       |
  402|       |			goto on_error;
  403|       |		}
  404|       |		libcnotify_printf(
  405|       |		 "%s: format class identifier\t\t: %" PRIs_SYSTEM "\n",
  406|       |		 function,
  407|       |		 guid_string );
  408|       |
  409|       |		if( libfguid_identifier_free(
  410|       |		     &guid,
  411|       |		     error ) != 1 )
  412|       |		{
  413|       |			libcerror_error_set(
  414|       |			 error,
  415|       |			 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  416|       |			 LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED,
  417|       |			 "%s: unable to free GUID.",
  418|       |			 function );
  419|       |
  420|       |			goto on_error;
  421|       |		}
  422|       |	}
  423|       |#endif /* defined( HAVE_DEBUG_OUTPUT ) */
  424|       |
  425|   347k|	if( ( internal_set->size < 24 )
  ------------------
  |  Branch (425:6): [True: 0, False: 347k]
  ------------------
  426|   347k|	 || ( (size_t) internal_set->size > byte_stream_size ) )
  ------------------
  |  Branch (426:6): [True: 0, False: 347k]
  ------------------
  427|      0|	{
  428|      0|		libcerror_error_set(
  429|      0|		 error,
  430|      0|		 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  431|      0|		 LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS,
  432|      0|		 "%s: invalid property set size value out of bounds.",
  433|      0|		 function );
  434|       |
  435|      0|		goto on_error;
  436|      0|	}
  437|   347k|	byte_stream_offset += 24;
  438|       |
  439|   347k|	if( memory_compare(
  ------------------
  |  |  107|   347k|	memcmp( (const void *) buffer1, (const void *) buffer2, size )
  ------------------
  |  Branch (439:6): [True: 2.93k, False: 344k]
  ------------------
  440|   347k|	     internal_set->identifier,
  441|   347k|	     libfwps_format_class_identifier_named_properties,
  442|   347k|	     16 ) == 0 )
  443|  2.93k|	{
  444|  2.93k|		property_record_type = LIBFWPS_RECORD_TYPE_NAMED;
  445|  2.93k|	}
  446|   344k|	else
  447|   344k|	{
  448|   344k|		property_record_type = LIBFWPS_RECORD_TYPE_NUMERIC;
  449|   344k|	}
  450|   353k|	while( byte_stream_offset < byte_stream_size )
  ------------------
  |  Branch (450:9): [True: 31.9k, False: 321k]
  ------------------
  451|  31.9k|	{
  452|  31.9k|		if( byte_stream_offset > ( byte_stream_size - 4 ) )
  ------------------
  |  Branch (452:7): [True: 16, False: 31.9k]
  ------------------
  453|     16|		{
  454|     16|			libcerror_error_set(
  455|     16|			 error,
  456|     16|			 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
  457|     16|			 LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL,
  458|     16|			 "%s: invalid byte stream size value too small.",
  459|     16|			 function );
  460|       |
  461|     16|			goto on_error;
  462|     16|		}
  463|  31.9k|		byte_stream_copy_to_uint32_little_endian(
  ------------------
  |  |   88|  31.9k|	( value )   = ( byte_stream )[ 3 ]; \
  |  |   89|  31.9k|	( value ) <<= 8; \
  |  |   90|  31.9k|	( value )  |= ( byte_stream )[ 2 ]; \
  |  |   91|  31.9k|	( value ) <<= 8; \
  |  |   92|  31.9k|	( value )  |= ( byte_stream )[ 1 ]; \
  |  |   93|  31.9k|	( value ) <<= 8; \
  |  |   94|  31.9k|	( value )  |= ( byte_stream )[ 0 ];
  ------------------
  464|  31.9k|		 &( byte_stream[ byte_stream_offset ] ),
  465|  31.9k|		 record_data_size );
  466|       |
  467|       |#if defined( HAVE_DEBUG_OUTPUT )
  468|       |		if( libcnotify_verbose != 0 )
  469|       |		{
  470|       |			libcnotify_printf(
  471|       |			 "%s: record: %d data size\t\t\t: %" PRIu32 "\n",
  472|       |			 function,
  473|       |			 record_index,
  474|       |			 record_data_size );
  475|       |		}
  476|       |#endif
  477|  31.9k|		if( record_data_size == 0 )
  ------------------
  |  Branch (477:7): [True: 25.4k, False: 6.48k]
  ------------------
  478|  25.4k|		{
  479|  25.4k|			break;
  480|  25.4k|		}
  481|  6.48k|		if( ( record_data_size > byte_stream_size )
  ------------------
  |  Branch (481:7): [True: 110, False: 6.37k]
  ------------------
  482|  6.48k|		 || ( byte_stream_offset > ( byte_stream_size - record_data_size ) ) )
  ------------------
  |  Branch (482:7): [True: 28, False: 6.34k]
  ------------------
  483|    138|		{
  484|    138|			libcerror_error_set(
  485|    138|			 error,
  486|    138|			 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  487|    138|			 LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS,
  488|    138|			 "%s: invalid record: %d data size value out of bounds.",
  489|    138|			 function,
  490|    138|			 record_index );
  491|       |
  492|    138|			goto on_error;
  493|    138|		}
  494|  6.34k|		if( libfwps_record_initialize(
  ------------------
  |  Branch (494:7): [True: 0, False: 6.34k]
  ------------------
  495|  6.34k|		     &property_record,
  496|  6.34k|		     property_record_type,
  497|  6.34k|		     error ) != 1 )
  498|      0|		{
  499|      0|			libcerror_error_set(
  500|      0|			 error,
  501|      0|			 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  502|      0|			 LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED,
  503|      0|			 "%s: unable to create property record: %d.",
  504|      0|			 function,
  505|      0|			 record_index );
  506|       |
  507|      0|			goto on_error;
  508|      0|		}
  509|  6.34k|		if( libfwps_record_copy_from_byte_stream(
  ------------------
  |  Branch (509:7): [True: 263, False: 6.08k]
  ------------------
  510|  6.34k|		     property_record,
  511|  6.34k|		     &( byte_stream[ byte_stream_offset ] ),
  512|  6.34k|		     record_data_size,
  513|  6.34k|		     ascii_codepage,
  514|  6.34k|		     error ) != 1 )
  515|    263|		{
  516|    263|			libcerror_error_set(
  517|    263|			 error,
  518|    263|			 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  519|    263|			 LIBCERROR_RUNTIME_ERROR_COPY_FAILED,
  520|    263|			 "%s: unable to copy property record: %d from byte stream.",
  521|    263|			 function,
  522|    263|			 record_index );
  523|       |
  524|    263|			goto on_error;
  525|    263|		}
  526|  6.08k|		if( libcdata_array_append_entry(
  ------------------
  |  Branch (526:7): [True: 0, False: 6.08k]
  ------------------
  527|  6.08k|		     internal_set->records_array,
  528|  6.08k|		     &entry_index,
  529|  6.08k|		     (intptr_t *) property_record,
  530|  6.08k|		     error ) != 1 )
  531|      0|		{
  532|      0|			libcerror_error_set(
  533|      0|			 error,
  534|      0|			 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  535|      0|			 LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED,
  536|      0|			 "%s: unable to append record: %d to array.",
  537|      0|			 function,
  538|      0|			 record_index );
  539|       |
  540|      0|			goto on_error;
  541|      0|		}
  542|  6.08k|		property_record = NULL;
  543|       |
  544|  6.08k|		byte_stream_offset += record_data_size;
  545|       |
  546|  6.08k|		record_index++;
  547|  6.08k|	}
  548|       |/* TODO print trailing data */
  549|       |
  550|       |#if defined( HAVE_DEBUG_OUTPUT )
  551|       |	if( libcnotify_verbose != 0 )
  552|       |	{
  553|       |		libcnotify_printf(
  554|       |		 "\n" );
  555|       |	}
  556|       |#endif
  557|   347k|	return( 1 );
  558|       |
  559|    455|on_error:
  560|       |#if defined( HAVE_DEBUG_OUTPUT )
  561|       |	if( guid != NULL )
  562|       |	{
  563|       |		libfguid_identifier_free(
  564|       |		 &guid,
  565|       |		 NULL );
  566|       |	}
  567|       |#endif
  568|    455|	if( property_record != NULL )
  ------------------
  |  Branch (568:6): [True: 263, False: 192]
  ------------------
  569|    263|	{
  570|    263|		libfwps_internal_record_free(
  571|    263|		 (libfwps_internal_record_t **) &property_record,
  572|    263|		 NULL );
  573|    263|	}
  574|    455|	return( -1 );
  575|   347k|}

libfwps_store_initialize:
   41|    929|{
   42|    929|	libfwps_internal_store_t *internal_store = NULL;
   43|    929|	static char *function                    = "libfwps_store_initialize";
   44|       |
   45|    929|	if( store == NULL )
  ------------------
  |  Branch (45:6): [True: 0, False: 929]
  ------------------
   46|      0|	{
   47|      0|		libcerror_error_set(
   48|      0|		 error,
   49|      0|		 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
   50|      0|		 LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE,
   51|      0|		 "%s: invalid store.",
   52|      0|		 function );
   53|       |
   54|      0|		return( -1 );
   55|      0|	}
   56|    929|	if( *store != NULL )
  ------------------
  |  Branch (56:6): [True: 0, False: 929]
  ------------------
   57|      0|	{
   58|      0|		libcerror_error_set(
   59|      0|		 error,
   60|      0|		 LIBCERROR_ERROR_DOMAIN_RUNTIME,
   61|      0|		 LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET,
   62|      0|		 "%s: invalid store value already set.",
   63|      0|		 function );
   64|       |
   65|      0|		return( -1 );
   66|      0|	}
   67|    929|	internal_store = memory_allocate_structure(
  ------------------
  |  |   64|    929|	(type *) memory_allocate( sizeof( type ) )
  |  |  ------------------
  |  |  |  |   60|    929|	malloc( size )
  |  |  ------------------
  ------------------
   68|    929|	                  libfwps_internal_store_t );
   69|       |
   70|    929|	if( internal_store == NULL )
  ------------------
  |  Branch (70:6): [True: 0, False: 929]
  ------------------
   71|      0|	{
   72|      0|		libcerror_error_set(
   73|      0|		 error,
   74|      0|		 LIBCERROR_ERROR_DOMAIN_MEMORY,
   75|      0|		 LIBCERROR_MEMORY_ERROR_INSUFFICIENT,
   76|      0|		 "%s: unable to create store.",
   77|      0|		 function );
   78|       |
   79|      0|		goto on_error;
   80|      0|	}
   81|    929|	if( memory_set(
  ------------------
  |  |  121|    929|	memset( (void *) buffer, (int) value, count )
  ------------------
  |  Branch (81:6): [True: 0, False: 929]
  ------------------
   82|    929|	     internal_store,
   83|    929|	     0,
   84|    929|	     sizeof( libfwps_internal_store_t ) ) == NULL )
   85|      0|	{
   86|      0|		libcerror_error_set(
   87|      0|		 error,
   88|      0|		 LIBCERROR_ERROR_DOMAIN_MEMORY,
   89|      0|		 LIBCERROR_MEMORY_ERROR_SET_FAILED,
   90|      0|		 "%s: unable to clear store.",
   91|      0|		 function );
   92|       |
   93|      0|		memory_free(
  ------------------
  |  |  100|      0|	free( (void *) buffer )
  ------------------
   94|      0|		 internal_store );
   95|       |
   96|      0|		return( -1 );
   97|      0|	}
   98|    929|	if( libcdata_array_initialize(
  ------------------
  |  Branch (98:6): [True: 0, False: 929]
  ------------------
   99|    929|	     &( internal_store->sets_array ),
  100|    929|	     0,
  101|    929|	     error ) != 1 )
  102|      0|	{
  103|      0|		libcerror_error_set(
  104|      0|		 error,
  105|      0|		 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  106|      0|		 LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED,
  107|      0|		 "%s: unable to create sets array.",
  108|      0|		 function );
  109|       |
  110|      0|		goto on_error;
  111|      0|	}
  112|    929|	*store = (libfwps_store_t *) internal_store;
  113|       |
  114|    929|	return( 1 );
  115|       |
  116|      0|on_error:
  117|      0|	if( internal_store != NULL )
  ------------------
  |  Branch (117:6): [True: 0, False: 0]
  ------------------
  118|      0|	{
  119|      0|		memory_free(
  ------------------
  |  |  100|      0|	free( (void *) buffer )
  ------------------
  120|      0|		 internal_store );
  121|      0|	}
  122|      0|	return( -1 );
  123|    929|}
libfwps_store_free:
  131|    929|{
  132|    929|	libfwps_internal_store_t *internal_store = NULL;
  133|    929|	static char *function                    = "libfwps_store_free";
  134|    929|	int result                               = 1;
  135|       |
  136|    929|	if( store == NULL )
  ------------------
  |  Branch (136:6): [True: 0, False: 929]
  ------------------
  137|      0|	{
  138|      0|		libcerror_error_set(
  139|      0|		 error,
  140|      0|		 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
  141|      0|		 LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE,
  142|      0|		 "%s: invalid store.",
  143|      0|		 function );
  144|       |
  145|      0|		return( -1 );
  146|      0|	}
  147|    929|	if( *store != NULL )
  ------------------
  |  Branch (147:6): [True: 929, False: 0]
  ------------------
  148|    929|	{
  149|    929|		internal_store = (libfwps_internal_store_t *) *store;
  150|    929|		*store         = NULL;
  151|       |
  152|    929|		if( libcdata_array_free(
  ------------------
  |  Branch (152:7): [True: 0, False: 929]
  ------------------
  153|    929|		     &( internal_store->sets_array ),
  154|    929|		     (int(*)(intptr_t **, libcerror_error_t **)) &libfwps_internal_set_free,
  155|    929|		     error ) != 1 )
  156|      0|		{
  157|      0|			libcerror_error_set(
  158|      0|			 error,
  159|      0|			 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  160|      0|			 LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED,
  161|      0|			 "%s: unable to free sets array.",
  162|      0|			 function );
  163|       |
  164|      0|			result = -1;
  165|      0|		}
  166|    929|		memory_free(
  ------------------
  |  |  100|    929|	free( (void *) buffer )
  ------------------
  167|    929|		 internal_store );
  168|    929|	}
  169|    929|	return( result );
  170|    929|}
libfwps_store_copy_from_byte_stream:
  181|    929|{
  182|    929|	libfwps_internal_store_t *internal_store = NULL;
  183|    929|	libfwps_set_t *set                       = NULL;
  184|    929|	static char *function                    = "libfwps_store_copy_from_byte_stream";
  185|    929|	size_t byte_stream_offset                = 0;
  186|    929|	uint32_t set_data_size                   = 0;
  187|    929|	int entry_index                          = 0;
  188|    929|	int set_index                            = 0;
  189|       |
  190|    929|	if( store == NULL )
  ------------------
  |  Branch (190:6): [True: 0, False: 929]
  ------------------
  191|      0|	{
  192|      0|		libcerror_error_set(
  193|      0|		 error,
  194|      0|		 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
  195|      0|		 LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE,
  196|      0|		 "%s: invalid store.",
  197|      0|		 function );
  198|       |
  199|      0|		return( -1 );
  200|      0|	}
  201|    929|	internal_store = (libfwps_internal_store_t *) store;
  202|       |
  203|    929|	if( byte_stream == NULL )
  ------------------
  |  Branch (203:6): [True: 0, False: 929]
  ------------------
  204|      0|	{
  205|      0|		libcerror_error_set(
  206|      0|		 error,
  207|      0|		 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
  208|      0|		 LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE,
  209|      0|		 "%s: invalid byte stream.",
  210|      0|		 function );
  211|       |
  212|      0|		return( -1 );
  213|      0|	}
  214|    929|	if( ( byte_stream_size < 4 )
  ------------------
  |  Branch (214:6): [True: 2, False: 927]
  ------------------
  215|    929|	 || ( byte_stream_size > (size_t) SSIZE_MAX ) )
  ------------------
  |  Branch (215:6): [True: 0, False: 927]
  ------------------
  216|      2|	{
  217|      2|		libcerror_error_set(
  218|      2|		 error,
  219|      2|		 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
  220|      2|		 LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS,
  221|      2|		 "%s: invalid byte stream size value out of bounds.",
  222|      2|		 function );
  223|       |
  224|      2|		return( -1 );
  225|      2|	}
  226|   348k|	while( byte_stream_offset < byte_stream_size )
  ------------------
  |  Branch (226:9): [True: 347k, False: 265]
  ------------------
  227|   347k|	{
  228|   347k|		if( byte_stream_offset > ( byte_stream_size - 4 ) )
  ------------------
  |  Branch (228:7): [True: 35, False: 347k]
  ------------------
  229|     35|		{
  230|     35|			libcerror_error_set(
  231|     35|			 error,
  232|     35|			 LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
  233|     35|			 LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL,
  234|     35|			 "%s: invalid byte stream size value too small.",
  235|     35|			 function );
  236|       |
  237|     35|			goto on_error;
  238|     35|		}
  239|   347k|		byte_stream_copy_to_uint32_little_endian(
  ------------------
  |  |   88|   347k|	( value )   = ( byte_stream )[ 3 ]; \
  |  |   89|   347k|	( value ) <<= 8; \
  |  |   90|   347k|	( value )  |= ( byte_stream )[ 2 ]; \
  |  |   91|   347k|	( value ) <<= 8; \
  |  |   92|   347k|	( value )  |= ( byte_stream )[ 1 ]; \
  |  |   93|   347k|	( value ) <<= 8; \
  |  |   94|   347k|	( value )  |= ( byte_stream )[ 0 ];
  ------------------
  240|   347k|		 &( byte_stream[ byte_stream_offset ] ),
  241|   347k|		 set_data_size );
  242|       |
  243|       |#if defined( HAVE_DEBUG_OUTPUT )
  244|       |		if( libcnotify_verbose != 0 )
  245|       |		{
  246|       |			libcnotify_printf(
  247|       |			 "%s: set: %d data size\t\t\t: %" PRIu32 "\n",
  248|       |			 function,
  249|       |			 set_index,
  250|       |			 set_data_size );
  251|       |		}
  252|       |#endif
  253|   347k|		if( set_data_size == 0 )
  ------------------
  |  Branch (253:7): [True: 8, False: 347k]
  ------------------
  254|      8|		{
  255|      8|			break;
  256|      8|		}
  257|   347k|		if( ( set_data_size > byte_stream_size )
  ------------------
  |  Branch (257:7): [True: 103, False: 347k]
  ------------------
  258|   347k|		 || ( byte_stream_offset > ( byte_stream_size - set_data_size ) ) )
  ------------------
  |  Branch (258:7): [True: 33, False: 347k]
  ------------------
  259|    136|		{
  260|    136|			libcerror_error_set(
  261|    136|			 error,
  262|    136|			 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  263|    136|			 LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS,
  264|    136|			 "%s: invalid set: %d data size value out of bounds.",
  265|    136|			 function,
  266|    136|			 set_index );
  267|       |
  268|    136|			goto on_error;
  269|    136|		}
  270|   347k|		if( libfwps_set_initialize(
  ------------------
  |  Branch (270:7): [True: 0, False: 347k]
  ------------------
  271|   347k|		     &set,
  272|   347k|		     error ) != 1 )
  273|      0|		{
  274|      0|			libcerror_error_set(
  275|      0|			 error,
  276|      0|			 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  277|      0|			 LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED,
  278|      0|			 "%s: unable to create set: %d.",
  279|      0|			 function,
  280|      0|			 set_index );
  281|       |
  282|      0|			goto on_error;
  283|      0|		}
  284|   347k|		( (libfwps_internal_set_t *) set )->is_managed = 1;
  285|       |
  286|   347k|		if( libfwps_set_copy_from_byte_stream(
  ------------------
  |  Branch (286:7): [True: 483, False: 347k]
  ------------------
  287|   347k|		     set,
  288|   347k|		     &( byte_stream[ byte_stream_offset ] ),
  289|   347k|		     (size_t) set_data_size,
  290|   347k|		     ascii_codepage,
  291|   347k|		     error ) != 1 )
  292|    483|		{
  293|    483|			libcerror_error_set(
  294|    483|			 error,
  295|    483|			 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  296|    483|			 LIBCERROR_RUNTIME_ERROR_COPY_FAILED,
  297|    483|			 "%s: unable to copy set: %d from byte stream.",
  298|    483|			 function,
  299|    483|			 set_index );
  300|       |
  301|    483|			goto on_error;
  302|    483|		}
  303|   347k|		if( libcdata_array_append_entry(
  ------------------
  |  Branch (303:7): [True: 0, False: 347k]
  ------------------
  304|   347k|		     internal_store->sets_array,
  305|   347k|		     &entry_index,
  306|   347k|		     (intptr_t *) set,
  307|   347k|		     error ) != 1 )
  308|      0|		{
  309|      0|			libcerror_error_set(
  310|      0|			 error,
  311|      0|			 LIBCERROR_ERROR_DOMAIN_RUNTIME,
  312|      0|			 LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED,
  313|      0|			 "%s: unable to append set: %d to array.",
  314|      0|			 function,
  315|      0|			 set_index );
  316|       |
  317|      0|			goto on_error;
  318|      0|		}
  319|   347k|		set = NULL;
  320|       |
  321|   347k|		byte_stream_offset += set_data_size;
  322|       |
  323|   347k|		set_index++;
  324|   347k|	}
  325|    273|	return( 1 );
  326|       |
  327|    654|on_error:
  328|    654|	if( set != NULL )
  ------------------
  |  Branch (328:6): [True: 483, False: 171]
  ------------------
  329|    483|	{
  330|    483|		libfwps_internal_set_free(
  331|    483|		 (libfwps_internal_set_t **) &set,
  332|    483|		 NULL );
  333|    483|	}
  334|    654|	libcdata_array_empty(
  335|    654|	 internal_store->sets_array,
  336|    654|	 (int(*)(intptr_t **, libcerror_error_t **)) &libfwps_internal_set_free,
  337|    654|	 NULL );
  338|       |
  339|    654|	return( -1 );
  340|    927|}

LLVMFuzzerTestOneInput:
   34|    929|{
   35|    929|	libfwps_store_t *store = NULL;
   36|       |
   37|    929|	if( libfwps_store_initialize(
  ------------------
  |  Branch (37:6): [True: 0, False: 929]
  ------------------
   38|    929|	     &store,
   39|    929|	     NULL ) != 1 )
   40|      0|	{
   41|      0|		return( 0 );
   42|      0|	}
   43|    929|	libfwps_store_copy_from_byte_stream(
   44|    929|	 store,
   45|    929|	 data,
   46|    929|	 size,
   47|    929|	 LIBFWPS_CODEPAGE_WINDOWS_1252,
   48|    929|	 NULL );
   49|       |
   50|    929|	libfwps_store_free(
   51|    929|	 &store,
   52|    929|	 NULL );
   53|       |
   54|    929|	return( 0 );
   55|    929|}

