#include "io.h"
#include "security.h"
-#ifdef ENABLE_SECURITY_DATA
-
/*
* Reads the security data from the metadata resource.
*
"(current total length = %"PRIu64", security "
"descriptor size = %"PRIu64")",
total_len, sd->sizes[i]);
+ ret = WIMLIB_ERR_INVALID_SECURITY_DATA;
+ goto out_free_sd;
}
total_len += sd->sizes[i];
if (total_len > (u64)sd->total_length) {
{
if (!sd)
return;
- wimlib_assert(sd->refcnt >= 1);
- if (sd->refcnt == 1) {
+ wimlib_assert(sd->refcnt != 0);
+ if (--sd->refcnt == 0) {
u8 **descriptors = sd->descriptors;
u32 num_entries = sd->num_entries;
if (descriptors)
FREE(sd->sizes);
FREE(sd->descriptors);
FREE(sd);
- } else {
- sd->refcnt--;
}
}
-
-#endif