Skip to content

Commit 0f0a4c0

Browse files
author
deepikabhavnani
committed
Check for NULL pointer before access
1 parent d08c819 commit 0f0a4c0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

platform/mbed_stats.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
void mbed_stats_stack_get(mbed_stats_stack_t *stats)
1313
{
14+
MBED_ASSERT(stats != NULL);
1415
memset(stats, 0, sizeof(mbed_stats_stack_t));
1516

1617
#if MBED_STACK_STATS_ENABLED && MBED_CONF_RTOS_PRESENT
@@ -38,6 +39,7 @@ void mbed_stats_stack_get(mbed_stats_stack_t *stats)
3839

3940
size_t mbed_stats_stack_get_each(mbed_stats_stack_t *stats, size_t count)
4041
{
42+
MBED_ASSERT(stats != NULL);
4143
memset(stats, 0, count*sizeof(mbed_stats_stack_t));
4244
size_t i = 0;
4345

0 commit comments

Comments
 (0)