Opened 10 years ago

Closed 3 years ago

#2086 closed defect (fixed)

osm2pgsql segfaults when readinga style file with more than MAX_STYLES styles

Reported by: avar Owned by: jburgess777@…
Priority: major Milestone:
Component: osm2pgsql Version:
Keywords: Cc:

Description

osm2pgsql allocates a fixed amount of memory for reading a style file of unknown length, once it's past MAX_STYLES (currently 1000) it'll start writing into unallocated memory & segfault.

It should be changed to malloc/realloc as required.

See [16573] for the 100 -> 1000 workaround.

Change History (4)

comment:1 Changed 10 years ago by avar

Summary: osm2pgsql segfaults when readinga style file with more than 1000 stylesosm2pgsql segfaults when readinga style file with more than MAX_STYLES styles

comment:2 Changed 10 years ago by jburgess777@…

Owner: changed from Tom Hughes to jburgess777@…

comment:3 Changed 8 years ago by Tom Hughes

Component: utilsosm2pgsql

comment:4 Changed 3 years ago by pnorman

Resolution: fixed
Status: newclosed

I remember fixing a lot of these types of problems with the C++ conversion, and MAX_STYLES is no longer in the code.

Note: See TracTickets for help on using tickets.