Skip to content

Commit c3eab03

Browse files
authored
Merge pull request #1289 from jan-cerny/pcre_exec_fail
Improve error message for pcre_exec fail
2 parents 44ff324 + bfcb4d8 commit c3eab03

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/OVAL/results/oval_cmp_basic.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ static oval_result_t strregcomp(const char *pattern, const char *test_str)
135135

136136
re = pcre_compile(pattern, PCRE_UTF8, &err, &errofs, NULL);
137137
if (re == NULL) {
138-
dE("Unable to compile regex pattern, "
139-
"pcre_compile() returned error (offset: %d): '%s'.\n", errofs, err);
138+
dE("Unable to compile regex pattern '%s', "
139+
"pcre_compile() returned error (offset: %d): '%s'.\n", pattern, errofs, err);
140140
return OVAL_RESULT_ERROR;
141141
}
142142

@@ -146,8 +146,8 @@ static oval_result_t strregcomp(const char *pattern, const char *test_str)
146146
} else if (ret == -1) {
147147
result = OVAL_RESULT_FALSE;
148148
} else {
149-
dE("Unable to match regex pattern, "
150-
"pcre_exec() returned error: %d.\n", ret);
149+
dE("Unable to match regex pattern '%s' on string '%s', "
150+
"pcre_exec() returned error: %d.\n", pattern, test_str, ret);
151151
result = OVAL_RESULT_ERROR;
152152
}
153153

0 commit comments

Comments
 (0)