Security fix for SQL injection

This commit is contained in:
Cédric Krier committed 2009-03-24 16:26:28 +01:00
1 parent f8ff221d55
commit eeaad4dab7
1 file changed
+2 -2
+2 -2
View File
@@ -164,8 +164,8 @@ class Party(OSV):
'GROUP BY l.party ' \
'HAVING ' + \
'AND'.join(['(SUM((COALESCE(l.debit, 0) - COALESCE(l.credit, 0))) ' \
+ ' ' + x[1] + ' ' + str(x[2]) + ') ' for x in args]),
[code] + today_value + [company_id])
+ ' ' + x[1] + ' %s) ' for x in args]),
[code] + today_value + [company_id] + [x[2] for x in args])
if not cursor.rowcount:
return [('id', '=', 0)]
return [('id', 'in', [x[0] for x in cursor.fetchall()])]