Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#5739 closed defect (fixed)

Failed tests in vfk after r27973

Reported by: Even Rouault Owned by: landa.martin@…
Priority: normal Milestone:
Component: OGR_SF Version: svn-trunk
Severity: normal Keywords: vfk
Cc:

Description

After r27973, failures occur on some environments

==> On the MacOSX Travis-CI instance : https://s3.amazonaws.com/archive.travis-ci.org/jobs/41171266/log.txt

Running tests from ogr/ogr_vfk.py

  TEST: ogr_vfk_1 ... Warning 1: In ExecuteSQL(INSERT INTO 'PAR' 
VALUES(�,0,'',NULL,3,,NULL,NULL,'',616567,NULL,1,1,NULL,1,NULL,,2,13,NULL,NULL,809,NULL,NULL,,NULL,,'',1,NULL)): 
near ",": syntax error

Warning 1: In ExecuteSQL(INSERT INTO 'SOBR' 
VALUES(,0,616567,93,NULL,,,651225.680000,1069521.500000,4,1,NULL)): near ",": 
syntax error

Warning 1: In ExecuteSQL(INSERT INTO 'SOBR' 
VALUES(,0,616567,93,NULL,,,651235.000000,1069517.150000,4,1,NULL)): near ",": 
syntax error

....

==> And on a Windows build, I get errors too :

  TEST: ogr_vfk_1 ... Warning 1: Recode from ISO-8859-2 to UTF-8 not 
supported, treated as ISO8859-1 to UTF-8.
Warning 1: In ExecuteSQL(INSERT INTO 'PAR' 
VALUES(─ç+=¶±B,0,'¿@K',NULL,3,─ç+=¶±B,NULL,NULL,'─ç+=¶±B',616567,NULL,1,1,NULL,1,NULL,─ç+=¶±B,2,13,NULL,NULL,809,NULL,NULL,─ç+=¶±B,NULL,─ç+=¶±B,'─ç+=¶±B',1,NULL)): 
near "=": syntax error
Warning 1: In ExecuteSQL(INSERT INTO 'SOBR' 
VALUES(─ç+=¶±B,0,616567,93,NULL,─ç+=¶±B,─ç+=¶±B,651225.680000,1069521.500000,4,1,NULL)): 
near "=": syntax error
Warning 1: In ExecuteSQL(INSERT INTO 'SOBR' 
VALUES(─ç+=¶±B,0,616567,93,NULL,─ç+=¶±B,─ç+=¶±B,651235.000000,1069517.150000,4,1,NULL)): 
near "=": syntax error
Warning 1: In ExecuteSQL(INSERT INTO 'SOBR' 
VALUES(─ç+=¶±B,0,616567,93,NULL,─ç+=¶±B,─ç+=¶±B,651244.470000,1069564.220000,4,1,NULL)): 
near "=": syntax error

Perhaps some uninitialized buffer ?

The MacOSX support does have iconv support. The Windows one does not.

Change History (3)

comment:1 by Even Rouault, 9 years ago

trunk r27995 "VFK: Fix error with C++ objects reported by Coverity that are the likely cause of failed tests on some platforms (trunk only, #5739)"

Coverity report:

** CID 1255625:  Wrapper object use after free  (WRAPPER_ESCAPE)
/ogr/ogrsf_frmts/vfk/vfkproperty.cpp: 121 in VFKProperty::GetValueS(bool) const()
/ogr/ogrsf_frmts/vfk/vfkproperty.cpp: 129 in VFKProperty::GetValueS(bool) const()


________________________________________________________________________________________________________
*** CID 1255625:  Wrapper object use after free  (WRAPPER_ESCAPE)
/ogr/ogrsf_frmts/vfk/vfkproperty.cpp: 121 in VFKProperty::GetValueS(bool) const()
115     const char *VFKProperty::GetValueS(bool escape) const
116     {
117         size_t ipos;
118         CPLString strValue(m_strValue);
119     
120         if (!escape)
>>>     CID 1255625:  Wrapper object use after free  (WRAPPER_ESCAPE)
>>>     The internal representation of local "strValue" escapes, but is destroyed when it exits scope.
121             return strValue.c_str();
122     
123         ipos = 0;
124         while (std::string::npos != (ipos = strValue.find("'", ipos))) {
125             strValue.replace(ipos, 1, "\'\'", 2);
126             ipos += 2;
127         }
128     
129         return strValue.c_str();
/ogr/ogrsf_frmts/vfk/vfkproperty.cpp: 129 in VFKProperty::GetValueS(bool) const()
123         ipos = 0;
124         while (std::string::npos != (ipos = strValue.find("'", ipos))) {
125             strValue.replace(ipos, 1, "\'\'", 2);
126             ipos += 2;
127         }
128     
>>>     CID 1255625:  Wrapper object use after free  (WRAPPER_ESCAPE)
>>>     The internal representation of local "strValue" escapes, but is destroyed when it exits scope.
129         return strValue.c_str();

comment:2 by Even Rouault, 9 years ago

Resolution: fixed
Status: newclosed

Yes, that fixed it

in reply to:  2 comment:3 by martinl, 9 years ago

Replying to rouault:

Yes, that fixed it

Thanks a lot! Martin

Note: See TracTickets for help on using tickets.