webservices: Reject end elements without a parent in the writer.
Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ed33639561
commit
6086ad0fe3
|
@ -1063,8 +1063,8 @@ static BOOL cmp_localname( const unsigned char *name1, ULONG len1, const unsigne
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct node *find_parent_element( struct node *node, const WS_XML_STRING *prefix,
|
struct node *find_parent_element( struct node *node, const WS_XML_STRING *prefix,
|
||||||
const WS_XML_STRING *localname )
|
const WS_XML_STRING *localname )
|
||||||
{
|
{
|
||||||
struct node *parent;
|
struct node *parent;
|
||||||
const WS_XML_STRING *str;
|
const WS_XML_STRING *str;
|
||||||
|
|
|
@ -32,6 +32,8 @@ WS_XML_STRING *alloc_xml_string( const unsigned char *, ULONG ) DECLSPEC_HIDDEN;
|
||||||
WS_XML_UTF8_TEXT *alloc_utf8_text( const unsigned char *, ULONG ) DECLSPEC_HIDDEN;
|
WS_XML_UTF8_TEXT *alloc_utf8_text( const unsigned char *, ULONG ) DECLSPEC_HIDDEN;
|
||||||
HRESULT append_attribute( WS_XML_ELEMENT_NODE *, WS_XML_ATTRIBUTE * ) DECLSPEC_HIDDEN;
|
HRESULT append_attribute( WS_XML_ELEMENT_NODE *, WS_XML_ATTRIBUTE * ) DECLSPEC_HIDDEN;
|
||||||
void free_attribute( WS_XML_ATTRIBUTE * ) DECLSPEC_HIDDEN;
|
void free_attribute( WS_XML_ATTRIBUTE * ) DECLSPEC_HIDDEN;
|
||||||
|
struct node *find_parent_element( struct node *, const WS_XML_STRING *,
|
||||||
|
const WS_XML_STRING * ) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
struct node
|
struct node
|
||||||
{
|
{
|
||||||
|
|
|
@ -546,10 +546,13 @@ static HRESULT write_startelement( struct writer *writer )
|
||||||
|
|
||||||
static HRESULT write_endelement( struct writer *writer )
|
static HRESULT write_endelement( struct writer *writer )
|
||||||
{
|
{
|
||||||
WS_XML_ELEMENT_NODE *elem = (WS_XML_ELEMENT_NODE *)writer->current;
|
struct node *node = find_parent_element( writer->current, NULL, NULL );
|
||||||
|
WS_XML_ELEMENT_NODE *elem = &node->hdr;
|
||||||
ULONG size;
|
ULONG size;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
|
if (!elem) return WS_E_INVALID_FORMAT;
|
||||||
|
|
||||||
/* '</prefix:localname>' */
|
/* '</prefix:localname>' */
|
||||||
|
|
||||||
size = elem->localName->length + 3 /* '</>' */;
|
size = elem->localName->length + 3 /* '</>' */;
|
||||||
|
|
Loading…
Reference in New Issue