Open t3chn0m4g3 opened 4 years ago
Hey Marcus,
htm_ftpDownload.c:81:2: error: 'strncpy' output truncated before terminating nul copying 7 bytes from a string of the same length [-Werror=stringop-truncation] strncpy(full_name, "plugin-", 7); ^
~~~~~~~ htm_ftpDownload.c:82:2: error: 'strncpy' output truncated before terminating nul copying 11 bytes from a string of the same length [-Werror=stringop-truncation] strncpy(&full_name[7], module_name, 256 < strlen(module_name) ? 256 : strlen(module_name)); ^~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make[4]: *** [Makefile:681: htm_ftpDownload.lo] Your compiler complains about the fact that strncpy() does not copy any null bytes. The two instances are fine, though.
Try the attached patch or edit src/modules/Makefile.am and add -Wno-stringop-truncation to AM_CFLAGS.
Let me know if this helps.
Tillmann
Hi Tillmann,
thanks for the explanation and the swift feedback 😄 Github seems to have blocked the attachment, no patch here.
However, based on your info I managed to build it, once adding -Werror -Wno-stringop-truncation -Wno-stringop-overflow
to both the Makefile.am
in src
and src/modules
.
Without -Wno-stringop-overflow
I run into ...
/bin/bash ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../.. -I../ -Wall -Werror -Wno-stringop-truncation -g -O2 -c -o htm_tftpDownload.lo htm_tftpDownload.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../.. -I../ -Wall -Werror -Wno-stringop-truncation -g -O2 -c htm_tftpDownload.c -fPIC -DPIC -o .libs/htm_tftpDownload.o
htm_tftpDownload.c: In function 'get_tftp_resource':
htm_tftpDownload.c:218:2: error: 'strncpy' specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
strncpy(tftp_command+2, save_file, strlen(save_file));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[4]: *** [Makefile:695: htm_tftpDownload.lo] Error 1
make[4]: Leaving directory '/root/honeytrap/src/modules'
make[3]: *** [Makefile:710: all-recursive] Error 1
make[3]: Leaving directory '/root/honeytrap/src/modules'
make[2]: *** [Makefile:486: all-recursive] Error 1
make[2]: Leaving directory '/root/honeytrap/src'
make[1]: Leaving directory '/root/honeytrap'
make[1]: *** [Makefile:402: all-recursive] Error 1
make: *** [Makefile:334: all] Error 2
Thanks for your help, appreciate if you could apply the patch.
Best regards, Marco.
When I try to build honeytrap in Debian Buster I get the following error ...
Any ideas?
UPDATE: Builds without problem in Debian Stretch.