intel / ittapi

Intel® Instrumentation and Tracing Technology (ITT) and Just-In-Time (JIT) API
88 stars 44 forks source link

Make the isValidAbsolutePath function more secure by using strnlen #146

Closed eparshut closed 5 months ago

eparshut commented 5 months ago

To make isValidAbsolutePath function more secure use the strnlen function instead of the strlen. Calling the strlen function can potentially be unsafe. The strlen function calculates the length of a string by counting characters until it reaches a null character and if the string is not properly null-terminated then strlen will continue reading memory beyond the end of the string, which can lead to undefined behavior or a program crash.