nbs-system / naxsi

NAXSI is an open-source, high performance, low rules maintenance WAF for NGINX
GNU General Public License v3.0
4.8k stars 606 forks source link

last version error compile #530

Closed rickygm closed 4 years ago

rickygm commented 4 years ago

Hi, I am trying to compile this latest version with nginx 1.18

-o objs/addon/naxsi_src/naxsi_runtime.o \
/rpm/naxsi-1.1a/naxsi_src/naxsi_runtime.c

/rpm/naxsi-1.1a/naxsi_src/naxsi_runtime.c: In function ‘ngx_http_output_forbidden_page’: /rpm/naxsi-1.1a/naxsi_src/naxsi_runtime.c:1279:7: error: ‘for’ loop initial declarations are only allowed in C99 mode for (size_t i = 0; line[i] && curr < end; i++) { ^ /rpm/naxsi-1.1a/naxsi_src/naxsi_runtime.c:1279:7: note: use option -std=c99 or -std=gnu99 to compile your code make[1]: [objs/addon/naxsi_src/naxsi_runtime.o] Error 1 make[1]: Leaving directory `/rpm/nginx-1.18.0' make: [build] Error 2

any idea?

wargio commented 4 years ago

how are you compiling it? the easiest way to fix this is to add -std=c99 to the CFLAGS, or just move size_t i outside the for loop.

wargio commented 4 years ago

@rickygm you can use master if you want. i just added a commit to fix this.

rickygm commented 4 years ago

OK , let me try

rickygm commented 4 years ago

ready , the master is version 1.1a?

wargio commented 4 years ago

yes. it was before my fix for your issue.

rickygm commented 4 years ago

oki oki