-
Notifications
You must be signed in to change notification settings - Fork 606
compilation on Ubuntu 20.04 fails #491
Comments
Similar compile error here:
|
Check out this PR: You have to change 2 lines: Was able to compile it then. Take care, |
I tested 0cda868 - working here, compiles without errors. See #492 (comment) |
Actually the first commit is correct. I see 18 bytes are allocated, so this includes the null character. naxsi/naxsi_src/naxsi_skeleton.c Line 390 in f73b525
I will change it, cancel second commit, when I have time. Cc @buixor |
One-liner for anyone using Naxsi v0.56 (not current source) with Nginx 1.17 & 1.18 on Ubuntu 20.04, change the location of
Tested and working here, feedback is welcomed. |
With the latest one-liner applied I was able to compile nginx 1.18 and Naxsi 0.56 as dynamic module without any errors. |
Hi @wargio I tried to compile v0.56 on alpine 3.11 and got these errors:
I fixed this by replacing the size of |
@wargio @ston1th It seems like the warning message is pointing out a misuse of strncat(). Specifying the length of src on 3rd argument is the same as calling strcat() You can change it to strcat() or memcpy() and add null termination. What you did with If you can't change the code, use -Wno-stringop-overflow flag to disable the warning. Made a PR to change to strcat(): The build is passing. Hopefully the above works on your "Alpine" image. |
FYI @wargio @ston1th Made a simple test to see how it behaves on 64 bit system: x/10s $rax 0x7fffffffd993: 0x23 0x00 0x00 0x00 0x00 Actually seems like allocated memory will have 0x00 (will be null terminated in that case). you string will be 0x23 0x00 0x00 with using 2 as a 3rd argument. If I understood it correctly. So your code will also I guess work. |
actually the warning is correct. that len field should refer to the size of the source string. |
should be fixed via #497 |
* Changes to strncpy() to remove compile warnings with Ubuntu 20.04 LTS. Source is controlled, so no need for strncpy() Tested with Nginx-1.18.0 and NAXSI-0.56 * Fix. Strcpy would add a terminating null character. Changes to memcpy()
Trying to compile nginx 1.18 with naxsi 0.56 on Ubuntu 20.04, but it fails, no probs on Ubuntu 18.04. Is this related to #480?
gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0
The text was updated successfully, but these errors were encountered: