Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define uprv_strncat(dst, src, n) \
- U_STANDARD_CPP_NAMESPACE strncat(dst, src, n)
- static char plugin_file[2048] = "";
- U_CAPI void U_EXPORT2
- uplug_init(UErrorCode *status)
- {
- ....
- uprv_strncpy(plugin_file, plugin_dir, 2047);
- uprv_strncat(plugin_file, U_FILE_SEP_STRING,2047);
- uprv_strncat(plugin_file, "icuplugins",2047);
- uprv_strncat(plugin_file, U_ICU_VERSION_SHORT ,2047);
- uprv_strncat(plugin_file, ".txt" ,2047);
- ....
- }
- This suspicious code was found in icu project by PVS-Studio static code analyzer.
- Warning message is:
- V645 The 'strncat' function call could lead to the 'plugin_file' buffer overflow. The bounds should not contain the size of the buffer, but a number of characters it can hold. icuplug.c 739
- 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