Opened 18 years ago

Closed 17 years ago

Last modified 17 years ago

#1950 closed defect (fixed)

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)

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 (5)

comment:1 by dmorissette, 17 years ago

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

comment:2 by szekerest, 17 years ago

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

comment:3 by szekerest, 17 years ago

Committed the fix for branch-4-10

 

comment:4 by dmorissette, 17 years ago

Resolution: fixed
Status: newclosed
I believe we can mark this bug FIXED then?

comment:5 by dmorissette, 17 years ago

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.