Opened 19 years ago

Closed 6 years ago

#758 closed defect (wontfix)

avc ReadOpenTable over sensitivity

Reported by: carl.anderson@… Owned by: warmerdam
Priority: normal Milestone:
Component: OGR_SF Version: unspecified
Severity: normal Keywords:
Cc: Markus Neteler

Description (last modified by Even Rouault)

I got zapped by a string sensitivity bug
I wanted mytable.pat   (polygon attribute table)
but the system opened mytable.patparcel   (region attribute table)

checking Arc/Info 7/8/9 (Solaris) I see that table names are left aligned space
padded entries in a 32 byte field.  Not sure for other Os's

this patch fixes this over sensitivity for my cases.

--- avc/avc_bin.c       2004-02-28 01:39:50.000000000 -0500
+++ avc2/avc_bin.c      2005-01-28 23:16:41.819696096 -0500
@@ -1868,6 +1868,7 @@
     char          *pszFname;
     GBool          bFound;
     int            i;
+    int                   name_len;
  
     /* Alloc a buffer big enough for the longest possible filename...
      */
@@ -1891,9 +1893,11 @@
     {
         while(!bFound && _AVCBinReadNextArcDir(hFile, &sTableDef) == 0)
         {
+            name_len = (int) strchr(sTableDef.szTableName,0x20) - (int)
sTableDef.szTableName;
+//          table names are space padded on the right to 32 chars
+            if ( name_len > 32 ) name_len = 32;
             if (!sTableDef.bDeletedFlag &&
-                EQUALN(sTableDef.szTableName, pszTableName,
-                       strlen(pszTableName)) &&
+               EQUALN(sTableDef.szTableName, pszTableName, name_len ) &&
                 _AVCBinReadInfoFileExists(pszInfoPath,
                                           sTableDef.szInfoFile,
                                           eCoverType))

Change History (3)

comment:1 by Even Rouault, 9 years ago

Description: modified (diff)

A sample dataset demonstrating the issue might have been usefull...

comment:2 by Even Rouault, 9 years ago

Priority: highnormal

All those tickets have more than one year and nobody has acted on it, so the priority is not so high

comment:3 by Jukka Rahkonen, 6 years ago

Resolution: wontfix
Status: newclosed

Won't fix without sample data, not sure if even with data. Arc/Info coverages are quite rare nowadays.

Note: See TracTickets for help on using tickets.