Skip to content

Commit 7c4de56

Browse files
committed
Avoid null dereference
1 parent e952fe8 commit 7c4de56

File tree

1 file changed

+6
-0
lines changed
  • src/plugins/dxf2shp_converter/dxflib/src

1 file changed

+6
-0
lines changed

src/plugins/dxf2shp_converter/dxflib/src/dl_dxf.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,14 @@ bool DL_Dxf::getChoppedLine( char *s, unsigned int size,
403403
*/
404404
bool DL_Dxf::stripWhiteSpace( char** s )
405405
{
406+
if ( !s || !( *s ) )
407+
return false;
408+
406409
// last non-NULL char:
407410
int lastChar = strlen( *s ) - 1;
411+
if ( lastChar < 0 )
412+
return false;
413+
408414
// QgsDebugMsg(QString("lastChar: %1").arg(lastChar));
409415

410416
// Is last character CR or LF?

0 commit comments

Comments
 (0)