diff options
| author | Sergey Fedoseev <fedoseev.sergey@gmail.com> | 2020-01-21 22:42:12 +0500 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-01-21 21:46:47 +0100 |
| commit | f2a725fba3abfef28503600e2fdaab6c30482e56 (patch) | |
| tree | 246f7ff5bbb3ee0f9c32817d19af89fa03649e84 /django | |
| parent | e4bc4f26b27122f5887a5eea811ff985d9ab8b8d (diff) | |
Fixed #30274 -- Prevented segmentation fault on LineString iteration.
This reverts commit 138a78ec8cab5e1df0c8ba2a3ee895cb756ff1ae and adds
a test for the regression.
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/gis/geos/linestring.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/contrib/gis/geos/linestring.py b/django/contrib/gis/geos/linestring.py index 85f29319e4..a85ecfff8c 100644 --- a/django/contrib/gis/geos/linestring.py +++ b/django/contrib/gis/geos/linestring.py @@ -91,7 +91,8 @@ class LineString(LinearGeometryMixin, GEOSGeometry): def __iter__(self): "Allow iteration over this LineString." - return iter(self._cs) + for i in range(len(self)): + yield self[i] def __len__(self): "Return the number of points in this LineString." |
