PVS-StudioWarnings

PVS-Studio warning V605 for PHP

Nov 18th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. PHP_CLI_API size_t sapi_cli_single_write(....)
  2. {
  3.   ....
  4.   size_t shell_wrote;
  5.   shell_wrote = cli_shell_callbacks.cli_shell_write(....);
  6.   if (shell_wrote > -1) {  //<==
  7.     return shell_wrote;
  8.   }
  9.   ....
  10. }
  11.  
  12. This suspicious code was found in PHP project by PVS-Studio static code analyzer.
  13. Warning message is:
  14. V605 Consider verifying the expression: shell_wrote > - 1. An unsigned value is compared to the number -1. php_cli.c 266
  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