From 0d460bcd65f484c1c2e415795f29b8d1949faacf Mon Sep 17 00:00:00 2001 From: Martin Hansson Date: Wed, 17 Jun 2009 16:58:33 +0200 Subject: Bug#44684: valgrind reports invalid reads in Item_func_spatial_collection::val_str When the concatenation function for geometry data collections reads the binary data it was not rigorous in checking that there is data available, leading to invalid reads and crashes. Fixed by making checking stricter. mysql-test/r/gis.result: Bug#44684: Test result mysql-test/t/gis.test: Bug#44684: Test case sql/item_geofunc.cc: Bug#44684: fix(es) - Check that there are 4 bytes available for type code. - Check that there is at least one point available for linestring. - Check that there are at least 2 points in a polygon and data for all the points. --- mysql-test/t/gis.test | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'mysql-test/t/gis.test') diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index 0dae4509518..4a60e777cc7 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -667,4 +667,28 @@ desc v1; drop view v1; drop table t1; +# +# Bug#44684: valgrind reports invalid reads in +# Item_func_spatial_collection::val_str +# +SELECT MultiPoint(12345,''); +SELECT MultiPoint(123451,''); +SELECT MultiPoint(1234512,''); +SELECT MultiPoint(12345123,''); + +SELECT MultiLineString(12345,''); +SELECT MultiLineString(123451,''); +SELECT MultiLineString(1234512,''); +SELECT MultiLineString(12345123,''); + +SELECT LineString(12345,''); +SELECT LineString(123451,''); +SELECT LineString(1234512,''); +SELECT LineString(12345123,''); + +SELECT Polygon(12345,''); +SELECT Polygon(123451,''); +SELECT Polygon(1234512,''); +SELECT Polygon(12345123,''); + --echo End of 5.1 tests -- cgit v1.2.1