mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-14 01:47:57 +00:00
Merge pull request #3966 from remo-lab/fix/sql-injection-truncate
Fix SQL injection in truncate_data_tables
This commit is contained in:
@@ -195,7 +195,7 @@ def truncate_data_tables(conn: Connection) -> None:
|
|||||||
WHERE tablename LIKE 'location_road_%'""")
|
WHERE tablename LIKE 'location_road_%'""")
|
||||||
|
|
||||||
for table in [r[0] for r in list(cur)]:
|
for table in [r[0] for r in list(cur)]:
|
||||||
cur.execute('TRUNCATE ' + table)
|
cur.execute(pysql.SQL('TRUNCATE {}').format(pysql.Identifier(table)))
|
||||||
|
|
||||||
conn.commit()
|
conn.commit()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user