Commit d9f2709b authored by Grzegorz Daniluk's avatar Grzegorz Daniluk

freestanding-wrapper: fix ptpd_netif_read_calibration_data(), check whether…

freestanding-wrapper: fix ptpd_netif_read_calibration_data(), check whether deltaTx and deltaRx pointers are not NULL to prevent memory corruption
parent 52c309d2
......@@ -592,14 +592,18 @@ int ptpd_netif_read_calibration_data(const char *ifaceName, uint64_t *deltaTx,
//check if tx is calibrated,
// if so read data
if(state.tx_calibrated)
*deltaTx = state.delta_tx;
{
if(deltaTx) *deltaTx = state.delta_tx;
}
else
return PTPD_NETIF_NOT_FOUND;
//check if rx is calibrated,
// if so read data
if(state.rx_calibrated)
*deltaRx = state.delta_rx;
{
if(deltaRx) *deltaRx = state.delta_rx;
}
else
return PTPD_NETIF_NOT_FOUND;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment