Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/XCCDF_POLICY/xccdf_policy_remediate.c
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ static inline int _parse_ansible_fix(const char *fix_text, struct oscap_list *va
int ovector[9];

const size_t fix_text_len = strlen(fix_text);
int start_offset = 0;
size_t start_offset = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that there is a problem that the start_offset parameter of the oscap_pcre_exec function is defined as int in the function declaration.

while (true) {
const int match = oscap_pcre_exec(re, fix_text, fix_text_len, start_offset,
0, ovector, sizeof(ovector) / sizeof(ovector[0]));
Expand Down
6 changes: 3 additions & 3 deletions src/common/oscap_pcre.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ struct oscap_pcre {
};


static inline int _oscap_pcre_opts_to_pcre(oscap_pcre_options_t opts)
static inline uint32_t _oscap_pcre_opts_to_pcre(oscap_pcre_options_t opts)
{
int res = 0;
uint32_t res = 0;
if (opts & OSCAP_PCRE_OPTS_UTF8)
res |= PCRE2_UTF;
if (opts & OSCAP_PCRE_OPTS_MULTILINE)
Expand Down Expand Up @@ -131,7 +131,7 @@ void oscap_pcre_set_match_limit_recursion(oscap_pcre_t *opcre, unsigned long lim
}

int oscap_pcre_exec(const oscap_pcre_t *opcre, const char *subject,
int length, int startoffset, oscap_pcre_options_t options,
size_t length, size_t startoffset, oscap_pcre_options_t options,
int *ovector, int ovecsize)
{
int rc = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/common/oscap_pcre.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ oscap_pcre_t* oscap_pcre_compile(const char *pattern, oscap_pcre_options_t optio
* negative error code on failure
*/
int oscap_pcre_exec(const oscap_pcre_t *opcre, const char *subject,
int length, int startoffset, oscap_pcre_options_t options,
size_t length, size_t startoffset, oscap_pcre_options_t options,
int *ovector, int ovecsize);

/**
Expand Down
Loading