Skip to content

Commit 68631fc

Browse files
committed
STM CRC driver: hal_crc_compute_partial() - validate input paramaters.
1 parent 511f370 commit 68631fc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

targets/TARGET_STM/mbed_crc_api.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ void hal_crc_compute_partial_start(const crc_mbed_config_t* config)
5555

5656
void hal_crc_compute_partial(const uint8_t *data, const size_t size)
5757
{
58-
HAL_CRC_Accumulate(&current_state, (uint32_t *)data, size);
58+
if (data && size) {
59+
HAL_CRC_Accumulate(&current_state, (uint32_t *)data, size);
60+
}
5961
}
6062

6163
uint32_t hal_crc_get_result(void)

0 commit comments

Comments
 (0)