Ticket #1950 (closed defect: fixed)

Opened 7 years ago

Last modified 6 years ago

msOGRLayerGetAutoStyle passes NULL pointer to GetRGBFromString causing access violation

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

Description (last modified by dmorissette) (diff)

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

Changed 6 years ago by dmorissette

  • cc dmorissette@… added
Tamas, were you waiting on something before applying this in CVS?

Changed 6 years ago 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

Changed 6 years ago by szekerest

Committed the fix for branch-4-10

 

Changed 6 years ago by dmorissette

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

Changed 6 years ago by dmorissette

  • cc dmorissette added
  • description modified (diff)

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

Note: See TracTickets for help on using tickets.