Navigation Menu

Skip to content

Commit

Permalink
Avoid string overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 16, 2015
1 parent 153dea2 commit e6f91ca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/providers/spatialite/qgsspatialiteconnection.cpp
Expand Up @@ -613,7 +613,9 @@ bool QgsSpatiaLiteConnection::isRasterlite1Datasource( sqlite3 * handle, const c
char table_raster[4192]; char table_raster[4192];
char sql[4192]; char sql[4192];


strcpy( table_raster, table ); strncpy( table_raster, table, 4192 );
table_raster[4191] = '\0';

len = strlen( table_raster ); len = strlen( table_raster );
if ( strlen( table_raster ) < 9 ) if ( strlen( table_raster ) < 9 )
return false; return false;
Expand Down

0 comments on commit e6f91ca

Please sign in to comment.