Added patchset to fix various upstream issues detected by Coverity.

This commit is contained in:
Sebastian Lackner
2015-05-30 17:15:23 +02:00
parent b942798ef9
commit 0432712e4e
5 changed files with 152 additions and 49 deletions

View File

@@ -0,0 +1,25 @@
From eba72a3ed5d6f61c92ce2926d8305d19dc66425b Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 30 May 2015 17:08:18 +0200
Subject: ws2_32: Fix uninitialized memory access in do_poll (Coverity).
---
dlls/ws2_32/socket.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index fdf68a3..60c6ec5 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -4794,7 +4794,7 @@ static int do_poll(struct pollfd *pollfds, int count, int timeout)
struct timeval tv1, tv2;
int ret, torig = timeout;
- if (timeout > 0) gettimeofday( &tv1, 0 );
+ if (timeout >= 0) gettimeofday( &tv1, 0 );
while ((ret = poll( pollfds, count, timeout )) < 0)
{
--
2.4.2

View File

@@ -0,0 +1,31 @@
From 173d42087f21dae75c8fb7299f5444c3d57a35c7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 30 May 2015 15:30:36 +0200
Subject: amstream: Correctly check return values in
IAMMultiMediaStreamImpl_Initialize (Coverity).
---
dlls/amstream/amstream.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/amstream/amstream.c b/dlls/amstream/amstream.c
index 800e48d..fcef7ec 100644
--- a/dlls/amstream/amstream.c
+++ b/dlls/amstream/amstream.c
@@ -256,11 +256,11 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_Initialize(IAMMultiMediaStream* if
This->StreamType = StreamType;
hr = IGraphBuilder_QueryInterface(This->pFilterGraph, &IID_IMediaSeeking, (void**)&This->media_seeking);
if (SUCCEEDED(hr))
- IGraphBuilder_QueryInterface(This->pFilterGraph, &IID_IMediaControl, (void**)&This->media_control);
+ hr = IGraphBuilder_QueryInterface(This->pFilterGraph, &IID_IMediaControl, (void**)&This->media_control);
if (SUCCEEDED(hr))
hr = CoCreateInstance(&CLSID_MediaStreamFilter, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&This->media_stream_filter);
if (SUCCEEDED(hr))
- IGraphBuilder_AddFilter(This->pFilterGraph, This->media_stream_filter, filternameW);
+ hr = IGraphBuilder_AddFilter(This->pFilterGraph, This->media_stream_filter, filternameW);
if (SUCCEEDED(hr))
{
IMediaEventEx* media_event = NULL;
--
2.4.2

View File

@@ -0,0 +1,26 @@
From 6addc4f5304995f32525dce5422bc6544d7b313d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 30 May 2015 15:36:43 +0200
Subject: kernel32: Correctly check for an empty short filename in
GetShortPathNameW (Coverity).
---
dlls/kernel32/path.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c
index f74b952..09b8b7f 100644
--- a/dlls/kernel32/path.c
+++ b/dlls/kernel32/path.c
@@ -528,7 +528,7 @@ DWORD WINAPI GetShortPathNameW( LPCWSTR longpath, LPWSTR shortpath, DWORD shortl
/* In rare cases (like "a.abcd") short path may be longer than original path.
* Make sure we have enough space in temp buffer. */
- if (wfd.cAlternateFileName && tmplen < strlenW(wfd.cAlternateFileName))
+ if (wfd.cAlternateFileName[0] && tmplen < strlenW(wfd.cAlternateFileName))
{
WCHAR *new_buf;
buf_len += strlenW(wfd.cAlternateFileName) - tmplen;
--
2.4.2