Advertisement
PVS-StudioWarnings

PVS-Studio warning V579 for apr

Nov 24th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. APR_DECLARE(char *)
  2. apr_cpystrn(char *dst, const char *src, apr_size_t dst_size);
  3.  
  4. APR_DECLARE(apr_status_t) apr_dir_read(....)
  5. {
  6.   ....
  7.   char *fspec = (char*)wdirname;
  8.   ....
  9.   apr_cpystrn(fspec, thedir->dirname, sizeof(fspec));
  10.   ....
  11. }
  12.  
  13. This suspicious code was found in apr project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V579 The apr_cpystrn function receives the pointer and its size as arguments. It is possibly a mistake. Inspect the third argument. dir.c 250
  16.  
  17. 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