HughP / geotoad

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

Backtick (`) in finder/hider name produce corrupted output #23

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Any search that yields caches with a hider or finder with names with
certain characters - an example cache is GC183RZ hidden by "J!/\/\/\/\`/

What is the expected output? What do you see instead?
The resulting output in a GPX has the <wpt> tag, then as soon as it has the
users name, it repeats, starting with the <wpt> tag again. This pattern
repeats thousands of times through the file.

Where the user is a finder, it similarly repeats part of the found tag
several times.

What version of the product are you using? On what operating system?
3.9.7.1 on both Windows & Linux.

Please provide any additional information below.

An example of the output:
<wpt lat="-35.20405" lon="149.097033333333">
  <time>2008-12-09T10:05:13.0000000-00:00</time>
  <name>GC183RZ</name>
  <desc>Under the Christmas Tree by J!/\/\/\/<wpt lat="-35.20405"
lon="149.097033333333">
  <time>2008-12-09T10:05:13.0000000-00:00</time>
  <name>GC183RZ</name>
  <desc>Under the Christmas Tree by /, traditional (2.0/2.5)</desc>
  <url>http://www.geocaching.com/seek/cache_details.aspx?wp=GC183RZ</url>
  <urlname>Under the Christmas Tree by J!/\/\/\/<wpt lat="-35.20405"
lon="149.097033333333">
  <time>2008-12-09T10:05:13.0000000-00:00</time>
  <name>GC183RZ</name>
  <desc>Under the Christmas Tree by J!/\/\/\/<wpt lat="-35.20405"
lon="149.097033333333">
  <time>2008-12-09T10:05:13.0000000-00:00</time>
  <name>GC183RZ</name>
  <desc>Under the Christmas Tree by J!/\/\/\/<wpt lat="-35.20405"
lon="149.097033333333">
  <time>2008-12-09T10:05:13.0000000-00:00</time>
  <name>GC183RZ</name>
  <desc>Under the Christmas Tree by /, traditional (2.0/2.5)</desc>
  <url>http://www.geocaching.com/seek/cache_details.aspx?wp=GC183RZ</url>
  <urlname>Under the Christmas Tree by J!/\/\/\/<wpt lat="-35.20405"
lon="149.097033333333">
  <time>2008-12-09T10:05:13.0000000-00:00</time>
  <name>GC183RZ</name>

Original issue reported on code.google.com by graham...@gmail.com on 15 Dec 2008 at 9:10

GoogleCodeExporter commented 9 years ago
I've had a closer look at this. The log file doesn't provide any indication of 
what
is going wrong, but it appears that the problem is caused when it encounters the
backslash character or possibly the combination of backslash and quote which is 
in
this user's name. Some of the caches around Canberra,Australia have this users 
name
in their text, and whenever it encounters a cache where his name is mentioned it
creates the corrupted gpx output. There is nothing in the -v logs to indicate 
why it
is producing corrupted output - it doesn't seem to get caught in any loops or
anything. What I suspect is happening, is that the backslash characters are 
getting
parsed as escape characters, and then causing buffer overflows. While there 
would
probably be a more elegant fix, the fix I have come up with is to simply 
replace all
occurrences of the \ character with the / character. I haven't encountered any
problems with doing this. Perhaps a more correct procedure would be to replace a
single \ with a double \\ but I haven't bothered attempting this.

I modified details.rb with the following changes:
After line 200 I inserted the following:
@waypointHash[wid]['creator'].gsub!(/\\/,"/")
This also meant that the next line needed to be changed to show the variable 
instead
of {$1} - debug "creator is #{@waypointHash[wid]['creator']}"
Also after line 409 I added:
text.gsub!(/\\/,"/")
The effect of both of these is to take out backslash characters and replace 
them with
the more benign forward slash.

Original comment by graham...@gmail.com on 28 Jan 2009 at 8:22

GoogleCodeExporter commented 9 years ago
I've had several instances as well with caches hidden in Okinawa Japan which 
contain ascii codes which are not 
allowed in gpx files.  The latest is a cache (GC1QGKD) containing ascii code 5 
in the long description.  Anyone 
else have this issue?

Original comment by niv...@gmail.com on 9 May 2009 at 3:56

GoogleCodeExporter commented 9 years ago
At first I thought this was a duplicate of issue 24, but this is bizarre.

Original comment by helixblue on 29 Jun 2009 at 3:04

GoogleCodeExporter commented 9 years ago

Original comment by helixblue on 30 Jun 2009 at 12:51

GoogleCodeExporter commented 9 years ago
Fixed in revision 524 - will be part of 3.10 release.

Original comment by helixblue on 24 Jan 2010 at 7:32

GoogleCodeExporter commented 9 years ago
Hi, I'm trying to insert math equations based upon LATEX using image tags such 
as: http://latex.codecogs.com/gif.latex?-\frac{v_0^2%20sin2\theta}{g} into my 
cache descriptions, however, I'm finding all instances of backslash are getting 
replaced by forward-slash, which is causing my equations to break.  Is my issue 
a result of the deliberate code change mentioned above?

Original comment by wjfra...@gmail.com on 14 Jul 2013 at 3:36

GoogleCodeExporter commented 9 years ago
Most probably unrelated, but may I ask what's the goal of this?
Including a "dynamic image" like this will cause each and every off-line 
caching tool to break - it's not a downloadable image in a strict sense, and 
won't be available to GeoToad users at all.
I'm not sure about c:geo and others.
IMHO the better solution is to have static images in the classical way, 
uploaded to the cache-related gallery.
Just my 0.02
-S

Original comment by Steve8x8 on 19 Sep 2013 at 7:04