Navigation Menu

Skip to content

Commit

Permalink
Avoid null dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 18, 2015
1 parent e952fe8 commit 7c4de56
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/plugins/dxf2shp_converter/dxflib/src/dl_dxf.cpp
Expand Up @@ -403,8 +403,14 @@ bool DL_Dxf::getChoppedLine( char *s, unsigned int size,
*/
bool DL_Dxf::stripWhiteSpace( char** s )
{
if ( !s || !( *s ) )
return false;

// last non-NULL char:
int lastChar = strlen( *s ) - 1;
if ( lastChar < 0 )
return false;

// QgsDebugMsg(QString("lastChar: %1").arg(lastChar));

// Is last character CR or LF?
Expand Down

0 comments on commit 7c4de56

Please sign in to comment.