diff --git a/platform/msm_shared/smem.c b/platform/msm_shared/smem.c index 1979b655d..df5ae73e2 100644 --- a/platform/msm_shared/smem.c +++ b/platform/msm_shared/smem.c @@ -269,7 +269,7 @@ size_t smem_get_hw_platform_name(void *buf, uint32_t buf_size) } hw_id = board_hardware_id(); - if (hw_id >= ARRAY_SIZE(hw_platform)) + if (hw_id >= ARRAY_SIZE(hw_platform) || hw_platform[hw_id] == '\0') hw_id = HW_PLATFORM_UNKNOWN; if (buf_size < strlen(hw_platform[hw_id]) + 1)