Fix SQL injection in truncate_data_tables

Signed-off-by: remo-lab <remopanda7@gmail.com>
This commit is contained in:
remo-lab
2026-02-05 17:04:10 +05:30
parent 8188689765
commit ae7301921a

View File

@@ -195,7 +195,7 @@ def truncate_data_tables(conn: Connection) -> None:
WHERE tablename LIKE 'location_road_%'""")
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()