Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve incompatible-pointer-types #1372

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 libclamav/regex/engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
endp = fast(m, start, stop, gf, gl);
if (endp == NULL) { /* a miss */
free(m->pmatch);
free(m->lastpos);

Check warning on line 190 in libclamav/regex/engine.c

View workflow job for this annotation

GitHub Actions / build-windows

'function': different 'const' qualifiers

Check warning on line 190 in libclamav/regex/engine.c

View workflow job for this annotation

GitHub Actions / build-windows

'function': different 'const' qualifiers
STATETEARDOWN(m);
return(REG_NOMATCH);
}
Expand All @@ -212,7 +212,7 @@
m->pmatch = (regmatch_t *)cli_max_malloc((m->g->nsub + 1) *
sizeof(regmatch_t));
if (m->pmatch == NULL) {
free(m->lastpos);

Check warning on line 215 in libclamav/regex/engine.c

View workflow job for this annotation

GitHub Actions / build-windows

'function': different 'const' qualifiers

Check warning on line 215 in libclamav/regex/engine.c

View workflow job for this annotation

GitHub Actions / build-windows

'function': different 'const' qualifiers
STATETEARDOWN(m);
return(REG_ESPACE);
}
Expand All @@ -223,7 +223,7 @@
dp = dissect(m, m->coldp, endp, gf, gl);
} else {
if (g->nplus > 0 && m->lastpos == NULL)
m->lastpos = (char **)cli_max_malloc((g->nplus+1) *
m->lastpos = (const char **)cli_max_malloc((g->nplus+1) *
Copy link
Contributor

Choose a reason for hiding this comment

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

It feels like the correct fix is to remove const in the lastpos definition. Check out the warnings in the "Files Changed" tab.

sizeof(char *));
if (g->nplus > 0 && m->lastpos == NULL) {
free(m->pmatch);
Expand Down Expand Up @@ -284,7 +284,7 @@
}

free(m->pmatch);
free(m->lastpos);

Check warning on line 287 in libclamav/regex/engine.c

View workflow job for this annotation

GitHub Actions / build-windows

'function': different 'const' qualifiers

Check warning on line 287 in libclamav/regex/engine.c

View workflow job for this annotation

GitHub Actions / build-windows

'function': different 'const' qualifiers
STATETEARDOWN(m);
return(0);
}
Expand Down
Loading