Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- png_size_t /* PRIVATE */
- png_check_keyword(png_structp png_ptr, png_charp key,
- png_charpp new_key)
- {
- ...
- if (key_len > 79)
- {
- png_warning(png_ptr,
- "keyword length must be 1 - 79 characters");
- new_key[79] = '\0';
- key_len = 79;
- }
- ...
- }
- This is what should have been written here: (*new_key)[79] = '\0';
- This suspicious code was found in PNG library project by PVS-Studio static code analyzer.
- Warning message is:
- V527 It is odd that the '\0' value is assigned to 'char' type pointer. Probably meant: *new_key [79] = '\0'. graphics3D pngwutil.c 1283
- 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