Skip to content

Commit

Permalink
Fixes (squash before merging)
Browse files Browse the repository at this point in the history
  • Loading branch information
evgenyz committed Aug 29, 2023
1 parent 3651403 commit 0e71918
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/OVAL/probes/unix/linux/rpmverifyfile_probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ static int _compare_file_with_current_file(oval_operation_t file_op, const char
}
int pcre_ret = oscap_pcre_exec(re, current_file, strlen(current_file), 0, 0, NULL, 0);
oscap_pcre_free(re);
if (pcre_ret == 0) {
if (pcre_ret > OSCAP_PCRE_ERR_NOMATCH) {
/* match */
*result_file = oscap_strdup(current_file);
} else if (pcre_ret == -1) {
} else if (pcre_ret == OSCAP_PCRE_ERR_NOMATCH) {
/* no match */
ret = 1;
goto cleanup;
Expand Down
4 changes: 3 additions & 1 deletion src/common/oscap_pcre.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,12 @@ oscap_pcre_t* oscap_pcre_compile(const char *pattern, oscap_pcre_options_t optio
PCRE2_UCHAR8 err_msg[1024];
pcre2_get_error_message_8(errno, err_msg, 1024);
dW("pcre2_compile_8 error: %s", err_msg);
*erroffset = erroffs;
*errptr = strdup((const char*)err_msg);
}
#else
res->re_extra = NULL;
res->re = pcre_compile(pattern, _oscap_pcre_opts_to_pcre(options), errptr, erroffset, tableptr);
res->re = pcre_compile(pattern, _oscap_pcre_opts_to_pcre(options), errptr, erroffset, NULL);
#endif
if (res->re == NULL) {
free(res);
Expand Down

0 comments on commit 0e71918

Please sign in to comment.