RfidResearchGroup / proxmark3

Iceman Fork - Proxmark3
http://www.icedev.se
GNU General Public License v3.0
3.65k stars 981 forks source link

strncat error in function infoHF_EMRTD_offline causing compile error. #1127

Closed NathanielJS1541 closed 3 years ago

NathanielJS1541 commented 3 years ago

Compilation problems Try compiling with verbose. make VERBOSE=1 with main makefile or make V=1 with cmake.

Describe the bug When I try to compile the latest master on Raspbain or Debian, I get the following compile error:

[-] CC src/cmdhfemrtd.c
mkdir -p obj/
gcc -MT obj/cmdhfemrtd.o -MMD -MP -MF obj/cmdhfemrtd.Td -Wall -Werror -O3 -fstrict-aliasing -pipe -Wbad-function-cast -Wredundant-decls -Wmissing-prototypes -Wchar-subscripts -Wshadow -Wundef -Wwrite-strings -Wunused -Wuninitialized -Wpointer-arith -Winline -Wformat -Wformat-security -Winit-self -Wmissing-include-dirs -Wnested-externs -Wmissing-declarations -Wempty-body -Wignored-qualifiers -Wmissing-field-initializers -Wtype-limits -Wold-style-definition -Wcast-align -Wno-error=cast-align -Wswitch-enum -Wno-error=switch-enum -Wstrict-prototypes -I./src -I./include -I../include -I../common -I../common_fpga -I./deps/amiitool -I./deps/cliparser -I./deps/hardnested -I./deps/jansson -I./deps/liblua -I../common/mbedtls -I./deps/reveng -I./deps/tinycbor -I./deps/whereami   -DHAVE_READLINE -DHAVE_BLUEZ -DHAVE_LUA_SWIG -DHAVE_GUI -c -o obj/cmdhfemrtd.o src/cmdhfemrtd.c
src/cmdhfemrtd.c: In function ‘infoHF_EMRTD_offline’:
src/cmdhfemrtd.c:1556:5: error: ‘strncat’ specified bound 1 equals source length [-Werror=stringop-overflow=]
     strncat(filepath, PATHSEP, 1);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/cmdhfemrtd.c:1593:13: error: ‘strncat’ specified bound 1 equals source length [-Werror=stringop-overflow=]
             strncat(filepath, PATHSEP, 1);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:793: obj/cmdhfemrtd.o] Error 1
make: *** [Makefile:137: client/all] Error 2

This seems to affect Debian-based systems only. I have successfully compiled the latest master on Kali and in Proxspace.

To Reproduce Steps to reproduce the behaviour:

  1. Use a Debian-based OS
  2. install dependencies and git pull the latest master
  3. make clean && make all
  4. Error occurs.

Expected behaviour Compile should be successful.

Desktop (please complete the following information):

doegox commented 3 years ago

thanks for reporting, I'll push a fix