diff options
author | Alexey Botchkov <holyfoot@askmonty.org> | 2013-03-10 23:08:05 +0400 |
---|---|---|
committer | Alexey Botchkov <holyfoot@askmonty.org> | 2013-03-10 23:08:05 +0400 |
commit | 511b9432637510617b04bde92c51a184c1e3aea8 (patch) | |
tree | ec8722e7d04b13f0bda411a5b2cd9dc89efd4570 /mysql-test | |
parent | 027e34e13b8d0baed51e26be8d4ffd86d9b3b041 (diff) | |
download | mariadb-git-511b9432637510617b04bde92c51a184c1e3aea8.tar.gz |
MDEV-4252 geometry query crashes server.
The bug was found by Alyssa Milburn.
If the number of points of a geometry feature read from
binary representation is greater than 0x10000000, then
the (uint32) (num_points * 16) will cut the higher byte,
which leads to various errors.
Fixed by additional check if (num_points > max_n_points).
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/gis.result | 3 | ||||
-rw-r--r-- | mysql-test/t/gis.test | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 8dad72fd3f8..69e73d018c7 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -1087,4 +1087,7 @@ NULL # SELECT GEOMETRYCOLLECTION((SELECT @@OLD)); ERROR 22007: Illegal non geometric '' value found during parsing +select astext(0x0100000000030000000100000000000010); +astext(0x0100000000030000000100000000000010) +NULL End of 5.1 tests diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index abda3e997bd..cc5d158f600 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -826,5 +826,6 @@ SELECT ISCLOSED(CONVERT(CONCAT(' ', 0x2), BINARY(20))); --error ER_ILLEGAL_VALUE_FOR_TYPE SELECT GEOMETRYCOLLECTION((SELECT @@OLD)); +select astext(0x0100000000030000000100000000000010); --echo End of 5.1 tests |