NdheerajNagar / ez-vcard

Automatically exported from code.google.com/p/ez-vcard
0 stars 0 forks source link

Parsing a VCard with wrongly encoded characters in URLs throws ezvcard.util.org.apache.commons.codec.DecoderException, not a CannotParseException #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Parse a vcard that contains an URL-encoded value that contains invalid 
digits in the encoding (for instance %4x)

What is the actual output?

java.lang.RuntimeException: 
ezvcard.util.org.apache.commons.codec.DecoderException: Invalid URL encoding: 
not a valid digit (radix 16): 61
at ezvcard.io.text.VCardReader.decodeQuotedPrintable(VCardReader.java:329)
at ezvcard.io.text.VCardReader.access$400(VCardReader.java:87)
at 
ezvcard.io.text.VCardReader$VCardDataStreamListenerImpl.readProperty(VCardReader
.java:410)
at ezvcard.io.text.VCardRawReader.parseLine(VCardRawReader.java:201)
at ezvcard.io.text.VCardRawReader.start(VCardRawReader.java:79)
at ezvcard.io.text.VCardReader.readNext(VCardReader.java:237)
at ezvcard.Ezvcard$ParserChainText.first(Ezvcard.java:677)
at ezvcard.Ezvcard$ParserChainTextReader.first(Ezvcard.java:729)

What is the expected output?

A VCardException (for instance, a CannotParseException) should be thrown 
because library callers will handle VCardException, but not all kinds of 
exceptions.

What version of ez-vcard are you using?

0.9.2

Please provide any additional information below.

Found while analysing a crash report of DAVdroid [http://davdroid.bitfire.at]

Original issue reported on code.google.com by i...@bitfire.at on 15 Mar 2014 at 11:27

GoogleCodeExporter commented 9 years ago
Fixed in r880.

When this happens, the value will instead be treated as plain-text and a parser 
warning will be logged.  Attached is a snapshot build.

Thanks for the report!

Original comment by mike.angstadt on 16 Mar 2014 at 6:00

Attachments: