From a5595d16c0f24924656813eccd0f0ac5c17c56a6 Mon Sep 17 00:00:00 2001 From: Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> Date: Wed, 20 Dec 2023 19:22:22 +0100 Subject: 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 --- src/lib/ndpi_utils.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src') 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; } } -- cgit v1.2.3