CRC: Removed assertion on NULL buffer

When length is zero, the buffer is not accessed. The CRC functions are used
inside several other layers where a 0-length buffer may have meanings in
different contexts and being able to pass 0-length NULL buffers to CRC as a
noop simplifies the code.
pull/7824/head
Christopher Haster 2018-09-03 09:20:47 -05:00 committed by GitHub
parent 683034db8a
commit 43651dfcdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 2 deletions

View File

@ -415,7 +415,6 @@ private:
int32_t bitwise_compute_partial(const void *buffer, crc_data_size_t size, uint32_t *crc) const
{
MBED_ASSERT(crc != NULL);
MBED_ASSERT(buffer != NULL);
const uint8_t *data = static_cast<const uint8_t *>(buffer);
uint32_t p_crc = *crc;
@ -460,7 +459,6 @@ private:
int32_t table_compute_partial(const void *buffer, crc_data_size_t size, uint32_t *crc) const
{
MBED_ASSERT(crc != NULL);
MBED_ASSERT(buffer != NULL);
const uint8_t *data = static_cast<const uint8_t *>(buffer);
uint32_t p_crc = *crc;