Menu

#9 FixEmptyString introduces errors

open
nobody
None
5
2004-09-04
2004-09-04
Marand
No

As noed in the Open Discussion forum, DXMLRPC has an
incorrect processing when an empty TAG appears in a
response, and this can be fixed by setting TRpcClient.
FixEmptyStrings := True, which causes TRpcClientParser.
Parse to invoke FixEmptyString on the result.

However, the code for FixEmptyString in XmlRpcCommon
makes some rather alarming modifications: basically, it will
replace 'empty' strings by the '[NULL]' string, and will also
accept incorrect and fix XML syntax like
<string></nil></string>, which no XML parser should
accept per the XML spec.

Further up the chain, the '[NULL]' string is disposed of in
TRpcClientParser.DataTag (with a note saying 'ugly null
string hack').

This, in turn means that any server answering with the
string value [NULL] will get improper behaviour.

Is there some reason (maybe a broken service that
needed to be used ?) why this hack was necessary, or
would it be safe to just process empty strings like other
strings ?

Discussion


Log in to post a comment.