Opened 8 years ago

Closed 8 years ago

Last modified 8 years 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 8 years ago.
use strcasecmp to filter properties in the isce driver (2.1 branch)
isce_trunk_strcasecmp.diff (5.3 KB ) - added by mazhe 8 years ago.
use strcasecmp to filter properties in the isce driver (trunk)
isce_trunk_equal.diff (5.1 KB ) - added by mazhe 8 years ago.
Switch strcmp()s to EQUAL to avoid case issues (patch for trunk)
isce_2.1_equal.diff (2.2 KB ) - added by mazhe 8 years ago.
Switch strcmp()s to EQUAL to avoid case issues (patch for 2.1.x)

Download all attachments as: .zip

Change History (10)

by mazhe, 8 years ago

Attachment: isce_2.1_strcasecmp.diff added

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

by mazhe, 8 years ago

Attachment: isce_trunk_strcasecmp.diff added

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

comment:1 by Even Rouault, 8 years ago

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 by mazhe, 8 years ago

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.

by mazhe, 8 years ago

Attachment: isce_trunk_equal.diff added

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

by mazhe, 8 years ago

Attachment: isce_2.1_equal.diff added

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

comment:3 by mazhe, 8 years ago

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 by Even Rouault, 8 years ago

Resolution: fixed
Status: newclosed

In 35255:

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

comment:5 by Even Rouault, 8 years ago

In 35256:

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

comment:6 by Even Rouault, 8 years ago

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