PVS-StudioWarnings

PVS-Studio warning V528 for Fennec Media Project

Nov 11th, 2014
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. void MP4RtpHintTrack::GetPayload(....)
  2. {
  3.   ...
  4.   if (pSlash != NULL) {
  5.     pSlash++;
  6.     if (pSlash != '\0') {
  7.       length = strlen(pRtpMap) - (pSlash - pRtpMap);
  8.       *ppEncodingParams = (char *)MP4Calloc(length + 1);
  9.       strncpy(*ppEncodingParams, pSlash, length);
  10.     }
  11. }
  12.  
  13. This is what should have been written here: (*pSlash != '\0').
  14.  
  15. This suspicious code was found in Fennec Media Project project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V528 It is odd that pointer to 'char' type is compared with the '\0' value. Probably meant: *pSlash != '\0'. rtphint.cpp 346
  18.  
  19. 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