toxvpn icon indicating copy to clipboard operation
toxvpn copied to clipboard

output truncated before terminating nul copying as many bytes from a string as its length

Open iphydf opened this issue 3 years ago • 0 comments

In function 'char* strncpy(char*, const char*, size_t)',
    inlined from 'void ToxVPN::SocketListener::broadcast(const char*)' at toxins/toxvpn/import/src/listener.cpp:93:12:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:34: error: 'char* __builtin_strncpy(char*, const char*, long unsigned int)' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
toxins/toxvpn/import/src/listener.cpp: In member function 'void ToxVPN::SocketListener::broadcast(const char*)':
toxins/toxvpn/import/src/listener.cpp:93:12: note: length computed here
   93 |     strncpy(copy, msg, strlen(msg));
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~

iphydf avatar Dec 01 '21 21:12 iphydf