提交 3370d223 编写于 作者: C chengjinsong2

修改编码规范

Signed-off-by: Nchengjinsong2 <chengjinsong2@huawei.com>
上级 63e0127a
......@@ -62,6 +62,11 @@ static void WriteLogoContent(int fd, const std::string &logoPath, uint32_t size)
return;
}
if (size <= 0 || size > MAX_LOGO_SIZE) {
BSH_LOGE("logo size is invalid!");
return;
}
char *buffer = reinterpret_cast<char *>(malloc(size));
if (buffer == nullptr) {
(void)fclose(rgbFile);
......@@ -120,7 +125,7 @@ static int WriteLogo(int fd, const std::string &logoPath)
return -1;
}
if (st.st_size < 0 || st.st_size > MAX_LOGO_SIZE) {
if (st.st_size <= 0 || st.st_size > MAX_LOGO_SIZE) {
BSH_LOGE("Invalid logo file with size ");
ClearLogo(fd);
return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册