webservices: Reject field mappings without name or namespace.

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hans Leidekker 2016-03-02 14:06:28 +01:00 committed by Alexandre Julliard
parent 7a6595bf51
commit 0fd7bb5389
2 changed files with 5 additions and 1 deletions

View File

@ -787,9 +787,12 @@ static void test_WsWriteElement(void)
f.mapping = WS_ATTRIBUTE_FIELD_MAPPING;
/* requires localName and ns to be set */
hr = WsWriteElement( writer, &desc, WS_WRITE_REQUIRED_POINTER, NULL, 0, NULL );
hr = WsWriteElement( writer, &desc, WS_WRITE_REQUIRED_POINTER, &test, sizeof(test), NULL );
ok( hr == E_INVALIDARG, "got %08x\n", hr );
hr = set_output( writer );
ok( hr == S_OK, "got %08x\n", hr );
f.localName = &localname;
f.ns = &ns;
hr = WsWriteElement( writer, &desc, WS_WRITE_REQUIRED_POINTER, &test, sizeof(test), NULL );

View File

@ -1323,6 +1323,7 @@ static HRESULT write_type_struct_field( struct writer *writer, WS_TYPE_MAPPING m
switch (desc->mapping)
{
case WS_ATTRIBUTE_FIELD_MAPPING:
if (!desc->localName || !desc->ns) return E_INVALIDARG;
if ((hr = write_add_attribute( writer, NULL, desc->localName, desc->ns, FALSE )) != S_OK)
return hr;
break;