Advertisement
PVS-StudioWarnings

PVS-Studio warning V555 for PHP

Nov 26th, 2014
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. static int strfilter_convert_append_bucket(
  2. {
  3.   size_t out_buf_size;
  4.   ....
  5.   size_t ocnt, icnt, tcnt;
  6.   ....
  7.   if (out_buf_size - ocnt > 0) { //<==
  8.     ....
  9.     php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
  10.   } else {
  11.     pefree(out_buf, persistent);
  12.   }
  13.   ....
  14. }
  15.  
  16. This suspicious code was found in PHP project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V555 The expression 'out_buf_size - ocnt > 0' will work as 'out_buf_size != ocnt'. filters.c 1702
  19.  
  20. 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
Advertisement