Ticket #1950 (closed defect: fixed)

Opened 2 years ago

Last modified 1 year ago

msOGRLayerGetAutoStyle passes NULL pointer to GetRGBFromString causing access violation

Reported by: szekerest Assigned to: szekerest
Priority: high Milestone:
Component: OGR Support Version: 5.0
Severity: normal Keywords:
Cc: dmorissette

Description (Last modified by dmorissette)

msOGRLayerGetAutoStyle may pass NULL pointer to GetRGBFromString causing access
violation.

In my test case the brush style in the OGR MapInfo tab file contains ForeColor
but does not contain BackColor style. In this case
poBrushStyle->BackColor(bIsNull) returns NULL and bIsNull = true;

To fix the problem the following code fragment is used:

pszColor = poBrushStyle->BackColor(bIsNull);
                  if (!bIsNull &&        
poBrushStyle->GetRGBFromString(pszColor,r,g,b,t))
    {
        MS_INIT_COLOR(c->styles[0].backgroundcolor, r, g, b);
    }

Change History

03/02/07 14:26:36 changed by dmorissette

  • cc set to dmorissette@mapgears.com.
Tamas, were you waiting on something before applying this in CVS?

03/02/07 18:49:04 changed by szekerest

I'm sure I have already fixed this problem for the CVS HEAD. 

"Revision 1.103  2006/10/22 17:48:24  tamas
Changed OGRLayerGetAutoStyle not to pass NULL pointer to GetRGBFromString
causing access violation."


However it have not been backported to 4.10 yet.

Tamas

03/03/07 10:25:48 changed by szekerest

Committed the fix for branch-4-10

 

03/06/07 14:37:20 changed by dmorissette

  • status changed from new to closed.
  • resolution set to fixed.
I believe we can mark this bug FIXED then?

05/02/07 15:03:18 changed by dmorissette

  • cc set to dmorissette.
  • description changed.

Note that the fix will be released in MapServer 4.10.2 (and 5.0).

The following GDAL bug is related to this issue as well: http://trac.osgeo.org/gdal/ticket/1571