Navigation Menu

Skip to content

Commit

Permalink
Fix potential buffer truncation
Browse files Browse the repository at this point in the history
Forward ported from kadas-albireo
  • Loading branch information
manisandro authored and nyalldawson committed Jun 19, 2018
1 parent d360150 commit 16673ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/providers/spatialite/qgsspatialiteconnection.cpp
Expand Up @@ -572,10 +572,10 @@ bool QgsSpatiaLiteConnection::isRasterlite1Datasource( sqlite3 *handle, const ch
int columns;
bool exists = false;
char table_raster[4192];
char sql[4192];
char sql[4258];

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

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

0 comments on commit 16673ae

Please sign in to comment.