You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix Klocwork non null terminated string with default C++11 ABI
After switching libstdc++ from the old to the default, new C++11 ABI,
Klocwork static analysis flags that assignment to std::string with a
string literal may result in a non null terminated string. While it is
not apparent whether this is a false-positive or not, initializing the
string with the literal by default resolves the Klocwork issue.
---------------------------------------------------------------------------
182 (Local) /__w/fpga-runtime-for-opencl/fpga-runtime-for-opencl/src/acl_hal_mmd.cpp:782 NNTS.MUST (1:Critical) Analyze
Buffer overflow of 'board_vendor_path._M_dataplus._M_p' due to non null terminated string 'board_vendor_path._M_dataplus._M_p'
* acl_hal_mmd.cpp:773: customer_board_vendor_path is false
* acl_hal_mmd.cpp:779: 'board_vendor_path._M_dataplus._M_p' may not be null-terminated after calling 'operator='.
* basic_string.h:705: 'this->_M_dataplus._M_p' may not be null-terminated after calling 'assign'.
* basic_string.h:1438: 'this->_M_dataplus._M_p' may not be null-terminated after calling '_M_replace'.
* basic_string.tcc:429: __new_size<=this->capacity() is false
* basic_string.tcc:465: 'this->_M_dataplus._M_p' may not be null-terminated after calling '_M_mutate'.
* basic_string.tcc:318: __pos is true
* basic_string.tcc:319: '__r' may not be null-terminated after calling '_S_copy'.
* basic_string.h:348: __n==1 is false
* basic_string.h:351: '__d' may not be null-terminated after calling 'copy'.
* char_traits.h:365: The size parameter may be less than length of source buffer.
* char_traits.h:365: '__s1' may not be null-terminated after calling '__builtin_memcpy'.
* basic_string.tcc:320: __len2 is false
* basic_string.tcc:320: __s&&__len2 is false
* basic_string.tcc:322: __how_much is false
* basic_string.tcc:327: _M_data(__r): copies '__r' into 'this->_M_dataplus._M_p'
* acl_hal_mmd.cpp:783: board_vendor_path.c_str(): returns 'board_vendor_path._M_dataplus._M_p'
* acl_hal_mmd.cpp:782: String 'board_vendor_path._M_dataplus._M_p' is not properly terminated and is passed as an argument to function 'printf'.
Current status 'Analyze'
---------------------------------------------------------------------------
183 (Local) /__w/fpga-runtime-for-opencl/fpga-runtime-for-opencl/src/acl_hal_mmd.cpp:798 NNTS.MUST (1:Critical) Analyze
Buffer overflow of 'board_vendor_path._M_dataplus._M_p' due to non null terminated string 'board_vendor_path._M_dataplus._M_p'
* acl_hal_mmd.cpp:773: customer_board_vendor_path is false
* acl_hal_mmd.cpp:779: 'board_vendor_path._M_dataplus._M_p' may not be null-terminated after calling 'operator='.
* basic_string.h:705: 'this->_M_dataplus._M_p' may not be null-terminated after calling 'assign'.
* basic_string.h:1438: 'this->_M_dataplus._M_p' may not be null-terminated after calling '_M_replace'.
* basic_string.tcc:429: __new_size<=this->capacity() is false
* basic_string.tcc:465: 'this->_M_dataplus._M_p' may not be null-terminated after calling '_M_mutate'.
* basic_string.tcc:318: __pos is true
* basic_string.tcc:319: '__r' may not be null-terminated after calling '_S_copy'.
* basic_string.h:348: __n==1 is false
* basic_string.h:351: '__d' may not be null-terminated after calling 'copy'.
* char_traits.h:365: The size parameter may be less than length of source buffer.
* char_traits.h:365: '__s1' may not be null-terminated after calling '__builtin_memcpy'.
* basic_string.tcc:320: __len2 is false
* basic_string.tcc:320: __s&&__len2 is false
* basic_string.tcc:322: __how_much is false
* basic_string.tcc:327: _M_data(__r): copies '__r' into 'this->_M_dataplus._M_p'
* acl_hal_mmd.cpp:782: debug_verbosity>=1 is false
* acl_hal_mmd.cpp:821: debug_verbosity>=1 is false
* acl_hal_mmd.cpp:798: board_vendor_path.c_str(): returns 'board_vendor_path._M_dataplus._M_p'
* acl_hal_mmd.cpp:798: String 'board_vendor_path._M_dataplus._M_p' is not properly terminated and is passed as an argument to function 'opendir'.
Current status 'Analyze'
0 commit comments