X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Freference.c;fp=src%2Freference.c;h=3238abe464434be1cd5be79e0cfb854ff6122984;hb=668c363a59c521f48eecbc4dd549c07a3e36179e;hp=1a83a4a6cbcf315b85051e591c758fac90a10e0f;hpb=320e646b45b894a25c4239d5a71d3bd9c2ec793b;p=wimlib diff --git a/src/reference.c b/src/reference.c index 1a83a4a6..3238abe4 100644 --- a/src/reference.c +++ b/src/reference.c @@ -33,6 +33,9 @@ #include "wimlib/lookup_table.h" #include "wimlib/wim.h" +#define WIMLIB_REF_MASK_PUBLIC (WIMLIB_REF_FLAG_GLOB_ENABLE | \ + WIMLIB_REF_FLAG_GLOB_ERR_ON_NOMATCH) + static int lte_clone_if_new(struct wim_lookup_table_entry *lte, void *_lookup_table) { @@ -76,6 +79,9 @@ wimlib_reference_resources(WIMStruct *wim, if (num_resource_wims != 0 && resource_wims == NULL) return WIMLIB_ERR_INVALID_PARAM; + if (ref_flags & ~WIMLIB_REF_MASK_PUBLIC) + return WIMLIB_ERR_INVALID_PARAM; + for (i = 0; i < num_resource_wims; i++) if (resource_wims[i] == NULL) return WIMLIB_ERR_INVALID_PARAM; @@ -195,6 +201,9 @@ wimlib_reference_resource_files(WIMStruct *wim, unsigned i; int ret; + if (ref_flags & ~WIMLIB_REF_MASK_PUBLIC) + return WIMLIB_ERR_INVALID_PARAM; + if (ref_flags & WIMLIB_REF_FLAG_GLOB_ENABLE) { for (i = 0; i < count; i++) { ret = reference_resource_glob(wim,