Author: akhaldi
Date: Sun Jun 5 19:27:31 2016
New Revision: 71559
URL:
http://svn.reactos.org/svn/reactos?rev=71559&view=rev
Log:
[JSPROXY] Sync with Wine Staging 1.9.11. CORE-11368
Modified:
trunk/reactos/dll/win32/jsproxy/main.c
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/jsproxy/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jsproxy/main.c?r…
==============================================================================
--- trunk/reactos/dll/win32/jsproxy/main.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/jsproxy/main.c [iso-8859-1] Sun Jun 5 19:27:31 2016
@@ -99,7 +99,7 @@
return HeapFree( GetProcessHeap(), 0, mem );
}
-static inline WCHAR *strdupAW( const char *src, DWORD len )
+static inline WCHAR *strdupAW( const char *src, int len )
{
WCHAR *dst = NULL;
if (src)
@@ -188,14 +188,28 @@
EnterCriticalSection( &cs_jsproxy );
- if (global_script->text)
- {
- LeaveCriticalSection( &cs_jsproxy );
- return FALSE;
- }
- if (buffer && buffer->dwStructSize == sizeof(*buffer) &&
buffer->lpszScriptBuffer &&
- (global_script->text = strdupAW( buffer->lpszScriptBuffer,
buffer->dwScriptBufferSize ))) ret = TRUE;
- else if ((global_script->text = load_script( tmpfile ))) ret = TRUE;
+ if (buffer && buffer->dwStructSize == sizeof(*buffer) &&
buffer->lpszScriptBuffer)
+ {
+ DWORD i, len = 0;
+ for (i = 0; i < buffer->dwScriptBufferSize; i++)
+ {
+ if (!buffer->lpszScriptBuffer[i]) break;
+ len++;
+ }
+ if (len == buffer->dwScriptBufferSize)
+ {
+ SetLastError( ERROR_INVALID_PARAMETER );
+ LeaveCriticalSection( &cs_jsproxy );
+ return FALSE;
+ }
+ heap_free( global_script->text );
+ if ((global_script->text = strdupAW( buffer->lpszScriptBuffer, len ))) ret
= TRUE;
+ }
+ else
+ {
+ heap_free( global_script->text );
+ if ((global_script->text = load_script( tmpfile ))) ret = TRUE;
+ }
LeaveCriticalSection( &cs_jsproxy );
return ret;
@@ -627,9 +641,18 @@
EnterCriticalSection( &cs_jsproxy );
- if (!global_script->text) goto done;
- if (!(urlW = strdupAW( url, len_url ))) goto done;
- if (hostname && !(hostnameW = strdupAW( hostname, len_hostname ))) goto
done;
+ if (!global_script->text)
+ {
+ SetLastError( ERROR_CAN_NOT_COMPLETE );
+ goto done;
+ }
+ if (hostname && len_hostname < strlen( hostname ))
+ {
+ SetLastError( ERROR_INSUFFICIENT_BUFFER );
+ goto done;
+ }
+ if (!(urlW = strdupAW( url, -1 ))) goto done;
+ if (hostname && !(hostnameW = strdupAW( hostname, -1 ))) goto done;
TRACE( "%s\n", debugstr_w(global_script->text) );
ret = run_script( global_script->text, urlW, hostnameW, proxy, len_proxy );
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sun Jun 5 19:27:31 2016
@@ -86,7 +86,7 @@
reactos/dll/win32/itircl # Synced to WineStaging-1.9.4
reactos/dll/win32/itss # Synced to WineStaging-1.9.4
reactos/dll/win32/jscript # Synced to WineStaging-1.9.11
-reactos/dll/win32/jsproxy # Synced to WineStaging-1.9.4
+reactos/dll/win32/jsproxy # Synced to WineStaging-1.9.11
reactos/dll/win32/loadperf # Synced to WineStaging-1.9.4
reactos/dll/win32/localspl # Synced to WineStaging-1.9.4
reactos/dll/win32/localui # Synced to WineStaging-1.9.4