intel-staging / libptpmgmt_iaclocklib

The Clock Manager is a library for monitoring network time synchronization on the local platform. Disclaimer: This project is under development. All source code and features on the main branch is for the purpose of testing or evaluation and not production ready. We will upstream the code and archive this GitHub repo thereafter.
Other
4 stars 5 forks source link

Add null check for dynamic cast in check_proxy_liveness #78

Closed yoongsiang2 closed 1 month ago

yoongsiang2 commented 1 month ago

This commit adds a null check for the dynamic cast of connectMsg.get() to ClientConnectMessage in the check_proxy_liveness function.

Previously, if the dynamic cast failed, the program would attempt to dereference a null pointer, leading to undefined behavior. With this change, if the dynamic cast fails, the function will print a debug message and return false, preventing the null pointer dereference.