PVS-StudioWarnings

PVS-Studio warning V541 for Firefox

Nov 20th, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. bool AdjustWebSocketHost(relayBuffer& buffer,
  2.                          connection_info_t *ci)
  3. {
  4.   ...
  5.   sprintf(newhost, "%s:%d", newhost,
  6.           PR_ntohs(inet_addr.inet.port));
  7.   ...
  8. }
  9.  
  10. The code might work, but this is a dangerous game.
  11.  
  12. This suspicious code was found in Firefox project by PVS-Studio static code analyzer.
  13. Warning message is:
  14. V541 It is dangerous to print the string 'newhost' into itself. ssltunnel.cpp 531
  15.  
  16. PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment