Don't append garbage data to tag names #161

Closed
wants to merge 1 commit into
from

Projects

None yet

3 participants

@TheDorkKnight

Bug was introduced in 662729c

The string should not be terminated at the end of the entire shared buffer. Rather, it should be terminated at the index after the end of the copied string.

This commit restores the original behaviour before 662729c

Moving the index variable into the for-loop scope is a good practice in general, but it introduced a bug in this particular case.

Example of bug:

A key like:
addr:housenumber
becomes
addr_housenumber ¬’/
or something like that, since the bytes after 'r' are undefined until byte number 255.

Jake Molnar Don't append garbage data to tag names
Bug was introduced in OSGeo@662729c

The string should be terminated at the
end of the entire shared buffer. Rather,
it should be terminated at the index
after copying stops.

This commit restores the original
behaviour before 662729c

Moving the index variable into the for-loop
scope is a good practice in general, but
not in this particular case
338eca5
@rouault
Member
rouault commented Oct 20, 2016

@schwehr Looks related to one of your commits. Given the date the issue is probably in the 2.1 branch as well

@schwehr schwehr closed this Oct 21, 2016
@rouault rouault added a commit that referenced this pull request Oct 21, 2016
@rouault rouault ogr_osm.py: test laundering of tags (#161)
git-svn-id: https://svn.osgeo.org/gdal/trunk@35848 f0d54148-0727-0410-94bb-9a71ac55c965
ba1bb14
@TheDorkKnight

@schwehr No prob, anytime!

I work with GDAL a lot, so I'm aware of quite a few small issues like this. However, I haven't gotten around to submitting patches before, since it's a bit cumbersome to raise/follow issues in trac.

Anyway, hopefully I'll be able to submit plenty of fixes in the future!

@schwehr
Contributor
schwehr commented Oct 21, 2016

@TheDorkKnight , Great! Looking forward to more patches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment