diff options
| author | Simon Charette <simon.charette@zapier.com> | 2019-09-15 23:25:50 -0400 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-09-16 08:24:40 +0200 |
| commit | 6c3dfba89215fc56fc27ef61829a6fff88be4abb (patch) | |
| tree | 01f6b6622a675c7167b004e069d7a9a512f3791e /django | |
| parent | bd7e0f81f8590eadcb820c976ba03c9b75bbcad6 (diff) | |
Fixed #30769 -- Fixed a crash when filtering against a subquery JSON/HStoreField annotation.
This was a regression introduced by 7deeabc7c7526786df6894429ce89a9c4b614086
to address CVE-2019-14234.
Thanks Tim Kleinschmidt for the report and Mariusz for the tests.
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/postgres/fields/hstore.py | 2 | ||||
| -rw-r--r-- | django/contrib/postgres/fields/jsonb.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/django/contrib/postgres/fields/hstore.py b/django/contrib/postgres/fields/hstore.py index 9548d180c9..0889f600a5 100644 --- a/django/contrib/postgres/fields/hstore.py +++ b/django/contrib/postgres/fields/hstore.py @@ -86,7 +86,7 @@ class KeyTransform(Transform): def as_sql(self, compiler, connection): lhs, params = compiler.compile(self.lhs) - return '(%s -> %%s)' % lhs, params + [self.key_name] + return '(%s -> %%s)' % lhs, tuple(params) + (self.key_name,) class KeyTransformFactory: diff --git a/django/contrib/postgres/fields/jsonb.py b/django/contrib/postgres/fields/jsonb.py index 821a747b9c..30c48a6018 100644 --- a/django/contrib/postgres/fields/jsonb.py +++ b/django/contrib/postgres/fields/jsonb.py @@ -112,7 +112,7 @@ class KeyTransform(Transform): lookup = int(self.key_name) except ValueError: lookup = self.key_name - return '(%s %s %%s)' % (lhs, self.operator), params + [lookup] + return '(%s %s %%s)' % (lhs, self.operator), tuple(params) + (lookup,) class KeyTextTransform(KeyTransform): |
