PVS-StudioWarnings

PVS-Studio warning V579 for peerblock

Nov 11th, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. void Curl_strntoupper(char *dest, const char *src, size_t n)
  2. {
  3.   if(n < 1)
  4.     return;
  5.  
  6.   do {
  7.     *dest++ = Curl_raw_toupper(*src);
  8.   } while(*src++ && --n);
  9. }
  10.  
  11. CURLcode Curl_rtsp_parseheader(....)
  12. {
  13.   ...
  14.   char *temp = strdup(header);
  15.   ...
  16.   Curl_strntoupper(temp, temp, sizeof(temp));
  17.   ...
  18. }
  19.  
  20. This suspicious code was found in peerblock project by PVS-Studio static code analyzer.
  21. Warning message is:
  22. V579 The Curl_strntoupper function receives the pointer and its size as arguments. It is possibly a mistake. Inspect the third argument. libcurl rtsp.c 753
  23.  
  24. 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