[ expat-Bugs-568904 ] expat sends wrong data to EasySoap ?

noreply@sourceforge.net noreply@sourceforge.net
Fri Jun 14 04:50:02 2002


Bugs item #568904, was opened at 2002-06-14 02:02
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=110127&aid=568904&group_id=10127

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: expat sends wrong  data to EasySoap ?

Initial Comment:
I'm not sure if the following  is an expat 1.95.3 bug
or an EasySoap 0.6 one.  I had to quick-patch it.

<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
SOAP-ENV:encodingSytle="http://schemas.xmlsoap/encoding/">
<SOAP-ENV:Body>
<m:stuff>
<tag>test</tag>
</m:stuff>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

This (kind of) structure is parsed by expat for
EasySoap.  EasySoap knows that the end-tag has been
reached because a parameter (uri) given by expat looks
like "http://XXX#Envelope" and it's a closing tag.

The uri given by expat is correct for the Envelope
opening tag "http://XXX#Envelope", correct for the Body
opening tag "http://XXX#Body", correct for the Body
closing tag "http://XXX#Body" but wrong for the
Envelope closing tag "http://XXX#Body".

I've traced the code and it's because the tag->uri 
points to the same address for all the tags.  It seems
that something is wrong with the "binding" structure in
the tag.

Here is the diff output, for xmlparse.c

907a908,911
>
> if(p->name.str!=NULL)
>   free(p->name.str)
>
2242c2246,2249
<    tagNamePtr->str = binding->uri;
---
>
> //  tagNamePtr->str = binding->uri;
>   tagNamePtr->str = strdup(binding->uri);
>

Well, since my problem was that raw link, and I didn't
had time to know if it was the right thing to do, a
strdup/free seemed appropriate.

Now I'm not sure it's a misuse from EasySoap or really
an expat bug (which had a wrong behaviour anyway since
it was while(0==0) {} on empty data because of that). 

Feedback welcome.



----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2002-06-14 04:49

Message:
Logged In: NO 

With a few more checks : the bug doesn't happens with expat
1.95.2

ediaz@veridis.com


----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2002-06-14 04:02

Message:
Logged In: NO 

I've tested expat 1.95.3 with EasySoap 0.5
The bug occured.
An older version of expat with EasySoap 0.5 runs fine.

I guess it's from expat's side then.

ediaz@veridis.com


----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2002-06-14 03:09

Message:
Logged In: NO 

I though my email would have been put in the report.
If you have any question/feedback it's : ediaz@veridis.com


----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2002-06-14 02:07

Message:
Logged In: NO 

I forgot to mention that
_ the bug happens with Linux as with WIN32.  The same patch
was applied for both of them.
_ I used EasySoap 0.6  This was not a problem with an older
version of expat and EasySoap 0.5.  I was unable to test
expat 1.95.3 with EasySoap 0.5 and the older expat I used
with EasySoap 0.6. 


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=110127&aid=568904&group_id=10127