mohamedsaeed27 / xmpphp

Automatically exported from code.google.com/p/xmpphp
0 stars 0 forks source link

Longer binary data contains extraneous linefeeds (upon reassembly?) #20

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Retrieve a vCard with photo from a contact, per XEP-0153 (
http://www.xmpp.org/extensions/xep-0153.html )
2. Attempt base64 decode
3. Base64 decode may fail due to linefeed(s) / newline(s) (ASCII character
10) present in character data of the photo's associated BINVAL

What is the expected output? What do you see instead?
-The BINVAL's data needs to be the original data prior to receipt and
reassembly, without the additional linefeeds.
-Instead, there may be one or more linefeeds in the base64-encoded binary
image data.
-Simply stripping all ASCII 10 characters seems to restore the data
consistently.

What version of the product are you using? On what operating system?

Please provide any additional information below.
-Simply stripping all ASCII 10 characters seems to restore the data
consistently.
-Suspicion: off-by-one or other offset or reassembly problem in
xmlstream.php code.

Original issue reported on code.google.com by developm...@central-b.com on 5 Jul 2008 at 4:23

GoogleCodeExporter commented 8 years ago
Thanks for reporting this.  I'll try to reproduce it.  Perhaps there is an
xml_parser_set_option that I need, or perhaps XML_OPTION_SKIP_WHITE is causing 
a problem?

Original comment by nathanfr...@gmail.com on 7 Jul 2008 at 2:38

GoogleCodeExporter commented 8 years ago
There have been a few references to stray linefeeds appearing after certain
characters through xml_parse's assembly. However, base64 encoding doesn't 
feature
many rare characters.

It's possible this is a problem with the xml_parse implementation and we 
haven't yet
had a chance to look into it further after testing the workaround.

Will post any findings.

Thanks for xmpphp!

Original comment by developm...@central-b.com on 8 Jul 2008 at 12:00

GoogleCodeExporter commented 8 years ago
It appears that this is how some servers (ejabberd) sends the data.  Sorry.

Original comment by nathanfr...@gmail.com on 28 Nov 2008 at 8:31