urlmon: Avoid accessing an uninitialized variable in a TRACE in validate_path.

Gerald Pfeifer gerald at pfeifer.com
Thu Nov 4 14:38:24 CDT 2010


In the if at the top of this hunk we avoid reading expected_len if
it's not initialized, whereas in the trace we happily access random
contents in expected_len.

Gerald
---
 dlls/urlmon/uri.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c
index 3bbe54f..fe37558 100644
--- a/dlls/urlmon/uri.c
+++ b/dlls/urlmon/uri.c
@@ -3810,7 +3810,7 @@ static HRESULT validate_path(const UriBuilder *builder, parse_data *data, DWORD
 
     if(!valid || (check_len && expected_len != data->path_len)) {
         TRACE("(%p %p %x): Invalid path component %s.\n", builder, data, flags,
-            debugstr_wn(component, expected_len));
+            debugstr_wn(component, check_len ? expected_len : -1) );
         return INET_E_INVALID_URL;
     }
 
-- 
1.7.2.2



More information about the wine-patches mailing list