Opened 7 months ago

Closed 7 months ago

Last modified 7 months ago

#6637 closed defect (fixed)

[PATCH] ISCE dataset properties are not case sensitive

Reported by: mazhe Owned by: warmerdam
Priority: normal Milestone: 2.1.2
Component: default Version: unspecified
Severity: normal Keywords: driver, isce
Cc:

Description

Hello,

Usage of multiple version of the ISCE software showed that it does not enforce case sensitivity in its XML header.

This could lead to basic image properties (x/y size, number of bands, etc) being copied to the metadata catalog that could then replace valid values when updating the header file.

Here are two patch, one for trunk and one for the 2.1 branch to switch usage of strcmp()'s to strcasecmp()'s to avoid this.

Attachments (4)

isce_2.1_strcasecmp.diff (2.3 KB) - added by mazhe 7 months ago.
use strcasecmp to filter properties in the isce driver (2.1 branch)
isce_trunk_strcasecmp.diff (5.3 KB) - added by mazhe 7 months ago.
use strcasecmp to filter properties in the isce driver (trunk)
isce_trunk_equal.diff (5.1 KB) - added by mazhe 7 months ago.
Switch strcmp()s to EQUAL to avoid case issues (patch for trunk)
isce_2.1_equal.diff (2.2 KB) - added by mazhe 7 months ago.
Switch strcmp()s to EQUAL to avoid case issues (patch for 2.1.x)

Download all attachments as: .zip

Change History (10)

Changed 7 months ago by mazhe

Attachment: isce_2.1_strcasecmp.diff added

use strcasecmp to filter properties in the isce driver (2.1 branch)

Changed 7 months ago by mazhe

Attachment: isce_trunk_strcasecmp.diff added

use strcasecmp to filter properties in the isce driver (trunk)

comment:1 Changed 7 months ago by Even Rouault

strcasecmp() doesn't exist in MSVC (at least not in older versions). Could you replace strcasecmp(a,b)==0 with EQUAL(a,b) ? The EQUAL macro defined in port/cpl_port.h will expand to whatever is available on the platform.

comment:2 Changed 7 months ago by mazhe

Ho, this is even better! I was suspicious of strcasecmp, and was a bit fast reading cpl_port.h. I'll update the patchs in a few secs.

Changed 7 months ago by mazhe

Attachment: isce_trunk_equal.diff added

Switch strcmp()s to EQUAL to avoid case issues (patch for trunk)

Changed 7 months ago by mazhe

Attachment: isce_2.1_equal.diff added

Switch strcmp()s to EQUAL to avoid case issues (patch for 2.1.x)

comment:3 Changed 7 months ago by mazhe

Here we go. It also filter the byte_order information to be included in metadata, as it could be saved with a wrong information too.

Thanks again

comment:4 Changed 7 months ago by Even Rouault

Resolution: fixed
Status: newclosed

In 35255:

ISCE: make parsing of properties case insensitive (patch by mazhe, fixes #6637)

comment:5 Changed 7 months ago by Even Rouault

In 35256:

ISCE: make parsing of properties case insensitive (patch by mazhe, fixes #6637)

comment:6 Changed 7 months ago by Even Rouault

Milestone: 2.1.2
Note: See TracTickets for help on using tickets.