Commit 0fd7bb53 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

webservices: Reject field mappings without name or namespace.

parent 7a6595bf
......@@ -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 );
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment