*
* @metadata_resource: An array that contains the uncompressed metadata
* resource for the WIM image.
- * @metadata_resource_len: The length of @metadata_resource. It must be at
- * least 8 bytes.
+ * @metadata_resource_len: The length of @metadata_resource.
* @sd_ret: A pointer to a pointer to a wim_security_data structure that
* will be filled in with a pointer to a new wim_security_data
* structure containing the security data on success.
const struct wim_security_data_disk *sd_disk;
const u8 *p;
- wimlib_assert(metadata_resource_len >= 8);
+ if (metadata_resource_len < 8)
+ return WIMLIB_ERR_INVALID_METADATA_RESOURCE;
sd = new_wim_security_data();
if (!sd)
/* Returns the index of the security descriptor having a SHA1 message digest of
* @hash. If not found, return -1. */
-int
+static int
lookup_sd(struct wim_sd_set *set, const u8 hash[SHA1_HASH_SIZE])
{
struct rb_node *node = set->rb_root.rb_node;