[PATCH] mshtml: fixed null ptr deref (Coverity)

Marcus Meissner marcus at jet.franken.de
Sat Sep 28 04:14:47 CDT 2013


1099450 Explicit null dereferenced

with data_len == 0 this would access it at NULL
---
 dlls/mshtml/navigate.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c
index f84af32..0c9a0ba 100644
--- a/dlls/mshtml/navigate.c
+++ b/dlls/mshtml/navigate.c
@@ -1089,7 +1089,8 @@ static HRESULT read_post_data_stream(nsIInputStream *stream, BOOL contains_heade
         post_data = new_data;
     }
 
-    post_data[data_len] = 0;
+    if (post_data)
+        post_data[data_len] = 0;
     request_data->post_data = post_data;
     request_data->post_data_len = data_len;
     TRACE("post_data = %s\n", debugstr_an(request_data->post_data, request_data->post_data_len));
-- 
1.7.10.4




More information about the wine-patches mailing list