aboutsummaryrefslogtreecommitdiff
path: root/src/lib/ndpi_utils.c
diff options
context:
space:
mode:
authorIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2023-12-20 19:22:22 +0100
committerGitHub <noreply@github.com>2023-12-20 19:22:22 +0100
commita5595d16c0f24924656813eccd0f0ac5c17c56a6 (patch)
tree5514d7138791f884dcd1726d7595053d2ff29116 /src/lib/ndpi_utils.c
parent149067b3fc4f3daafaa0cb8c2a5dab376b3ae975 (diff)
CI: update list of compilers (#2223)
Try using latest gcc and clang versions. We still care about RHEL7: since handling a RHEL7 runner on GitHub is quite complex, let try to use a similar version of gcc, at least
Diffstat (limited to 'src/lib/ndpi_utils.c')
-rw-r--r--src/lib/ndpi_utils.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/lib/ndpi_utils.c b/src/lib/ndpi_utils.c
index 3c7fb3f25..f066a7ec3 100644
--- a/src/lib/ndpi_utils.c
+++ b/src/lib/ndpi_utils.c
@@ -1708,9 +1708,9 @@ static int ndpi_is_xss_injection(char* query) {
static void ndpi_compile_rce_regex() {
PCRE2_UCHAR pcreErrorStr[128];
PCRE2_SIZE pcreErrorOffset;
- int pcreErrorCode;
+ int i, pcreErrorCode = 0;
- for(int i = 0; i < N_RCE_REGEX; i++) {
+ for(i = 0; i < N_RCE_REGEX; i++) {
comp_rx[i] = (struct pcre2_struct*)ndpi_malloc(sizeof(struct pcre2_struct));
comp_rx[i]->compiled = pcre2_compile((PCRE2_SPTR)rce_regex[i], PCRE2_ZERO_TERMINATED, 0, &pcreErrorCode,
@@ -1746,9 +1746,10 @@ static int ndpi_is_rce_injection(char* query) {
}
pcre2_match_data *pcreMatchData;
- int pcreExecRet;
+ int i, pcreExecRet;
+ unsigned long j;
- for(int i = 0; i < N_RCE_REGEX; i++) {
+ for(i = 0; i < N_RCE_REGEX; i++) {
unsigned int length = strlen(query);
pcreMatchData = pcre2_match_data_create_from_pattern(comp_rx[i]->compiled, NULL);
@@ -1789,16 +1790,16 @@ static int ndpi_is_rce_injection(char* query) {
size_t ushlen = sizeof(ush_commands) / sizeof(ush_commands[0]);
- for(unsigned long i = 0; i < ushlen; i++) {
- if(strstr(query, ush_commands[i]) != NULL) {
+ for(j = 0; j < ushlen; j++) {
+ if(strstr(query, ush_commands[j]) != NULL) {
return 1;
}
}
size_t pwshlen = sizeof(pwsh_commands) / sizeof(pwsh_commands[0]);
- for(unsigned long i = 0; i < pwshlen; i++) {
- if(strstr(query, pwsh_commands[i]) != NULL) {
+ for(j = 0; j < pwshlen; j++) {
+ if(strstr(query, pwsh_commands[j]) != NULL) {
return 1;
}
}