Skip to content

Commit e6f91ca

Browse files
committed
Avoid string overflow
1 parent 153dea2 commit e6f91ca

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/providers/spatialite/qgsspatialiteconnection.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,9 @@ bool QgsSpatiaLiteConnection::isRasterlite1Datasource( sqlite3 * handle, const c
613613
char table_raster[4192];
614614
char sql[4192];
615615

616-
strcpy( table_raster, table );
616+
strncpy( table_raster, table, 4192 );
617+
table_raster[4191] = '\0';
618+
617619
len = strlen( table_raster );
618620
if ( strlen( table_raster ) < 9 )
619621
return false;

0 commit comments

Comments
 (0)