Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GPX] HTML decoding issue when a large content is included in description #21444

Open
robert-wettstaedt opened this issue Nov 25, 2024 · 0 comments

Comments

@robert-wettstaedt
Copy link

robert-wettstaedt commented Nov 25, 2024

Description

The POI description supports HTML in GPX files. In order to add HTML to a GPX file, the HTML-entities need to be encoded so that they do not infer with the XML structure of the GPX format.

Usually OsmAnd is able to decode the HTML before rendering it. But if there is a large amount of content before some encoded entities, the decoding fails. The limit seems to be somewhere between 65k-70k characters.

This might not be restricted to only GPX files.

EDIT: I just realized that it might be related to a 16-bit integer problem as 2^16 = 65.536. I did some tests again and somewhere in that range I started to encounter this issue. But I was unable to verify exactly what part of the GPX waypoint needs to exceed that number to cause problems.

Steps to reproduce

  • Download this GPX sample file
  • Open with OsmAnd (if asked select "Import as GPX file")
  • Navigate to Null Island
  • Warning - Might be slow: Select one of the POIs ("1 character", "65k characters" or "70k characters")
  • Open the POI details and click on the "Read full" button in the description section

Actual result

  • The "1 character" and "65k characters" POI descriptions correctly show the decoded "✅" emoji

  • The "70k characters" POI description fails to decode the emoji

Expected result

Regardless of the length of the content that precedes an HTML-encoded string, the HTML should be decoded correctly.

Your Environment (required)

WARNING Crash-Logs MAY contain information you deem sensitive.
Review this CAREFULLY before posting your issue!

OsmAnd Version: 4.8.6
Android/iOS version: GrapheneOS - Android 14
Device model: Google Pixel 5
Crash-Logs: no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant