diff --git a/libselinux/src/label_file.c b/libselinux/src/label_file.c index c220fbf9..1b6b8124 100644 --- a/libselinux/src/label_file.c +++ b/libselinux/src/label_file.c @@ -472,9 +472,9 @@ static struct selabel_lookup_rec *lookup(struct selabel_handle *rec, if (compile_regex(data, spec, NULL) < 0) goto finish; if (spec->stem_id == -1) - rc = pcre_exec(spec->regex, spec->sd, key, strlen(key), 0, 0, NULL, 0); + rc = pcre_exec(spec->regex, get_pcre_extra(spec), key, strlen(key), 0, 0, NULL, 0); else - rc = pcre_exec(spec->regex, spec->sd, buf, strlen(buf), 0, 0, NULL, 0); + rc = pcre_exec(spec->regex, get_pcre_extra(spec), buf, strlen(buf), 0, 0, NULL, 0); if (rc == 0) { spec->matches++; diff --git a/libselinux/src/label_file.h b/libselinux/src/label_file.h index 8e78b25d..b2e463b6 100644 --- a/libselinux/src/label_file.h +++ b/libselinux/src/label_file.h @@ -42,6 +42,11 @@ struct saved_data { int alloc_stems; }; +static inline pcre_extra *get_pcre_extra(struct spec *spec) +{ + return spec->sd; +} + static inline mode_t string_to_mode(char *mode) { size_t len;