ntdll: Fix manifest attribute parsing.

This commit is contained in:
Nikolay Sivov 2014-01-01 22:00:40 +04:00 committed by Alexandre Julliard
parent b6ba53e572
commit 1e1084232d
2 changed files with 23 additions and 1 deletions

View File

@ -74,6 +74,11 @@ static const char manifest1[] =
"<assemblyIdentity version=\"1.0.0.0\" name=\"Wine.Test\" type=\"win32\"></assemblyIdentity>" "<assemblyIdentity version=\"1.0.0.0\" name=\"Wine.Test\" type=\"win32\"></assemblyIdentity>"
"</assembly>"; "</assembly>";
static const char manifest1_1[] =
"<assembly xmlns = \"urn:schemas-microsoft-com:asm.v1\" manifestVersion = \"1.0\">"
"<assemblyIdentity version = \"1.0.0.0\" name = \"Wine.Test\" type = \"win32\"></assemblyIdentity>"
"</assembly>";
static const char manifest2[] = static const char manifest2[] =
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">" "<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
"<assemblyIdentity version=\"1.2.3.4\" name=\"Wine.Test\" type=\"win32\">" "<assemblyIdentity version=\"1.2.3.4\" name=\"Wine.Test\" type=\"win32\">"
@ -1748,6 +1753,13 @@ static void test_actctx(void)
pReleaseActCtx(handle); pReleaseActCtx(handle);
} }
/* test for whitespace handling in Eq ::= S? '=' S? */
create_manifest_file("test1_1.manifest", manifest1_1, -1, NULL, NULL);
handle = test_create("test1_1.manifest");
ok(handle != INVALID_HANDLE_VALUE, "got %p\n", handle);
DeleteFileA("test1_1.manifest");
pReleaseActCtx(handle);
if(!create_manifest_file("test1.manifest", manifest1, -1, NULL, NULL)) { if(!create_manifest_file("test1.manifest", manifest1, -1, NULL, NULL)) {
skip("Could not create manifest file\n"); skip("Could not create manifest file\n");
return; return;

View File

@ -1125,13 +1125,23 @@ static BOOL next_xml_attr(xmlbuf_t* xmlbuf, xmlstr_t* name, xmlstr_t* value,
ptr = xmlbuf->ptr; ptr = xmlbuf->ptr;
while (ptr < xmlbuf->end && *ptr != '=' && *ptr != '>' && !isxmlspace(*ptr)) ptr++; while (ptr < xmlbuf->end && *ptr != '=' && *ptr != '>' && !isxmlspace(*ptr)) ptr++;
if (ptr == xmlbuf->end || *ptr != '=') return FALSE; if (ptr == xmlbuf->end) return FALSE;
name->ptr = xmlbuf->ptr; name->ptr = xmlbuf->ptr;
name->len = ptr-xmlbuf->ptr; name->len = ptr-xmlbuf->ptr;
xmlbuf->ptr = ptr; xmlbuf->ptr = ptr;
/* skip spaces before '=' */
while (ptr < xmlbuf->end && *ptr != '=' && isxmlspace(*ptr)) ptr++;
if (ptr == xmlbuf->end || *ptr != '=') return FALSE;
/* skip '=' itself */
ptr++; ptr++;
if (ptr == xmlbuf->end) return FALSE;
/* skip spaces after '=' */
while (ptr < xmlbuf->end && *ptr != '"' && *ptr != '\'' && isxmlspace(*ptr)) ptr++;
if (ptr == xmlbuf->end || (*ptr != '"' && *ptr != '\'')) return FALSE; if (ptr == xmlbuf->end || (*ptr != '"' && *ptr != '\'')) return FALSE;
value->ptr = ++ptr; value->ptr = ++ptr;