mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
Fixed clang malloc integer overflow warnings.
This commit is contained in:
@@ -266,7 +266,7 @@ static BOOL test_peer_load_icon(freerdp_peer* client)
|
||||
/* Max */
|
||||
fgets(line, sizeof(line), fp);
|
||||
|
||||
if (!(rgb_data = malloc(context->icon_width * context->icon_height * 3)))
|
||||
if (!(rgb_data = calloc(context->icon_height, context->icon_width * 3)))
|
||||
goto out_fail;
|
||||
|
||||
for (i = 0; i < context->icon_width * context->icon_height * 3; i++)
|
||||
@@ -278,8 +278,7 @@ static BOOL test_peer_load_icon(freerdp_peer* client)
|
||||
}
|
||||
|
||||
/* background with same size, which will be used to erase the icon from old position */
|
||||
if (!(context->bg_data = malloc(context->icon_width * context->icon_height *
|
||||
3)))
|
||||
if (!(context->bg_data = calloc(context->icon_height, context->icon_width * 3)))
|
||||
goto out_fail;
|
||||
|
||||
memset(context->bg_data, 0xA0, context->icon_width * context->icon_height * 3);
|
||||
|
||||
Reference in New Issue
Block a user