[PATCH v4 0/1] MR1774: Coverity fixes
Signed-off-by: Fabian Maurer <dark.shadow4(a)web.de> -- v4: https://gitlab.winehq.org/wine/wine/-/merge_requests/1774
From: Fabian Maurer <dark.shadow4(a)web.de> Signed-off-by: Fabian Maurer <dark.shadow4(a)web.de> --- dlls/urlmon/sec_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/urlmon/sec_mgr.c b/dlls/urlmon/sec_mgr.c index e6d1864b1e7..0d81e4dfda9 100644 --- a/dlls/urlmon/sec_mgr.c +++ b/dlls/urlmon/sec_mgr.c @@ -1276,7 +1276,7 @@ static LPDWORD build_zonemap_from_reg(void) if (used == allocated) { LPDWORD new_data; - new_data = realloc(data, allocated * sizeof(DWORD)); + new_data = realloc(data, allocated * 2 * sizeof(DWORD)); if (!new_data) goto cleanup; memset(new_data + allocated, 0, allocated * sizeof(DWORD)); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/1774
On Mon Dec 12 15:24:19 2022 +0000, Hans Leidekker wrote:
I would prefer to see all these cases fixed as suggested by Alex. It would also be nice if you could put the wldap32 changes in a separate MR. Alright, new MR is at https://gitlab.winehq.org/wine/wine/-/merge_requests/1795
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/1774#note_19485
This merge request was approved by Alex Henrie. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1774
I just realized that the memset in build_zonemap_from_reg is completely unnecessary. You can simplify the code like this: ``` if (used == allocated) { LPDWORD new_data; allocated *= 2; new_data = realloc(data, allocated * sizeof(DWORD)); if (!new_data) goto cleanup; data = new_data; } ``` -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1774#note_19667
participants (3)
-
Alex Henrie (@alexhenrie) -
Fabian Maurer -
Fabian Maurer (@DarkShadow44)