Opened 16 years ago

Closed 16 years ago

#2572 closed defect (fixed)

Segmentation fault in msSplitData in maporaclespatial.c

Reported by: aalbarello Owned by: fsimon@…
Priority: normal Milestone: 5.2 release
Component: Input - Native Oracle Spatial Support Version: svn-trunk (development)
Severity: normal Keywords:
Cc: sdlime

Description

data_version is defined as char[3] in function msSplitData on line 284 of maporaclespatial.c (as of svn-trunk revision 7504), although on lines 424 through 429 up to 4 bytes are copied into the string (e.g. "VERSION 10g" in the DATA definition leads to "10g" plus the final null character being written to the buffer). This can cause segmentation faults, and particularly so on Linux, most likely due to the different memory alignment. Defining data_version as char[4] solves the problem.

Adding some length checks to avoid similar buffer overflows in msSplitData, at least as far as data_version and tok_function is concerned, wouldn't hurt anyways.

Attachments (1)

fix2572.diff (447 bytes ) - added by aalbarello 16 years ago.
Attaching a patch against r7680.

Download all attachments as: .zip

Change History (4)

comment:1 by tomkralidis, 16 years ago

Component: MapServer C LibraryInput - Native Oracle Spatial Support
Milestone: 5.2 release
Owner: changed from sdlime to fsimon@…
Version: 5.0svn-trunk (development)

comment:2 by aalbarello, 16 years ago

Cc: sdlime added; fsimon@… removed

I hope this can be fixed in time for Mapserver 5.2. CC'ing Steve as the fix is trivial and I haven't yet heard from the Oracle Spatial maintainer.

Andreas

by aalbarello, 16 years ago

Attachment: fix2572.diff added

Attaching a patch against r7680.

comment:3 by sdlime, 16 years ago

Resolution: fixed
Status: newclosed

Fixed in r7699.

Steve

Note: See TracTickets for help on using tickets.