Skip to content

Commit 16673ae

Browse files
manisandronyalldawson
authored andcommittedJun 19, 2018
Fix potential buffer truncation
Forward ported from kadas-albireo
1 parent d360150 commit 16673ae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎src/providers/spatialite/qgsspatialiteconnection.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -572,10 +572,10 @@ bool QgsSpatiaLiteConnection::isRasterlite1Datasource( sqlite3 *handle, const ch
572572
int columns;
573573
bool exists = false;
574574
char table_raster[4192];
575-
char sql[4192];
575+
char sql[4258];
576576

577-
strncpy( table_raster, table, sizeof sql );
578-
table_raster[ sizeof sql - 1 ] = '\0';
577+
strncpy( table_raster, table, sizeof table_raster );
578+
table_raster[ sizeof table_raster - 1 ] = '\0';
579579

580580
size_t len = strlen( table_raster );
581581
if ( strlen( table_raster ) < 9 )

0 commit comments

Comments
 (0)
Please sign in to comment.