Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
iphydf opened this issue Dec 1, 2021 · 0 comments

Comments

@iphydf
Copy link
Contributor

iphydf commented Dec 1, 2021

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));
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant