Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static size_t php_ftp_dirstream_read(....)
- {
- size_t tmp_len;
- ....
- /* Trim off trailing whitespace characters */
- tmp_len--;
- while (tmp_len >= 0 && //<==
- (ent->d_name[tmp_len] == '\n' ||
- ent->d_name[tmp_len] == '\r' ||
- ent->d_name[tmp_len] == '\t' ||
- ent->d_name[tmp_len] == ' ')) {
- ent->d_name[tmp_len--] = '\0';
- }
- ....
- }
- This suspicious code was found in PHP project by PVS-Studio static code analyzer.
- Warning message is:
- V547 Expression 'tmp_len >= 0' is always true. Unsigned type value is always >= 0. ftp_fopen_wrapper.c 639
- 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