LibreCAD / libdxfrw

Successor of https://sourceforge.net/projects/libdxfrw/, developed for LibreCAD, by LibreCAD Contributors, usable for all
GNU General Public License v2.0
194 stars 72 forks source link

fix "iterator after end" error on some strings #61

Closed TAImatem closed 2 years ago

TAImatem commented 2 years ago

fixed unsafe iterator manipulation, which could trigger "iterator after end" error while parsing strings that contains '\' symbol close to end, i.e. on this LTYPE entry:


LTYPE
  2
ZIGZAG
 70
     0
  3
Zig zag /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
 72
    65
 73
     4
 40
20.32254
 49
0.00254
 49
-5.08
 49
-10.16
 49
-5.08```
TAImatem commented 2 years ago

BTW, I wonder if support for >2 byte unicode characters should be thought of

lordofbikes commented 2 years ago

many thanks :+1: