winebrowser: Fix allocation count (Coverity)

André Hentschel nerv at dawncrow.de
Sun Jan 15 08:17:43 CST 2017


CID 1364328

Signed-off-by: André Hentschel <nerv at dawncrow.de>
---
 programs/winebrowser/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/programs/winebrowser/main.c b/programs/winebrowser/main.c
index 4ec1d14..304ac14 100644
--- a/programs/winebrowser/main.c
+++ b/programs/winebrowser/main.c
@@ -82,7 +82,7 @@ static int launch_app( const WCHAR *candidates, const WCHAR *argv1 )
     {
         WCHAR **args = CommandLineToArgvW( candidates, &count );
 
-        if (!(argv_new = HeapAlloc( GetProcessHeap(), 0, (count + 1) * sizeof(*argv_new) ))) break;
+        if (!(argv_new = HeapAlloc( GetProcessHeap(), 0, (count + 2) * sizeof(*argv_new) ))) break;
         for (i = 0; i < count; i++) argv_new[i] = strdup_unixcp( args[i] );
         argv_new[count] = cmdline;
         argv_new[count + 1] = NULL;
-- 
2.7.4




More information about the wine-patches mailing list