STM CRC driver: hal_crc_compute_partial() - validate input paramaters.

pull/6831/head
Przemyslaw Stekiel 2018-06-07 14:52:52 +02:00
parent 511f3703c3
commit 68631fcaa9
1 changed files with 3 additions and 1 deletions

View File

@ -55,7 +55,9 @@ void hal_crc_compute_partial_start(const crc_mbed_config_t* config)
void hal_crc_compute_partial(const uint8_t *data, const size_t size)
{
HAL_CRC_Accumulate(&current_state, (uint32_t *)data, size);
if (data && size) {
HAL_CRC_Accumulate(&current_state, (uint32_t *)data, size);
}
}
uint32_t hal_crc_get_result(void)