diff options
author | Georgi Kodinov <georgi.kodinov@oracle.com> | 2013-03-28 17:37:29 +0200 |
---|---|---|
committer | Georgi Kodinov <georgi.kodinov@oracle.com> | 2013-03-28 17:37:29 +0200 |
commit | e927bda69f5213725c95615641db1bf511a9fcab (patch) | |
tree | fa5c5e27d5beb3164d49f89052837a35f45f8585 /sql/spatial.h | |
parent | e85c90b9d51f58b65809fb4d8224b898d2a3ebb8 (diff) | |
download | mariadb-git-e927bda69f5213725c95615641db1bf511a9fcab.tar.gz |
Addendum #1 to the fix for bug #16451878 : GEOMETRY QUERY CRASHES SERVER
Fixed the get_data_size() methods for multi-point features to check properly for end
of their respective data arrays.
Extended the point checking function to take a 3d optional argument so cases where
there's additional data in each array element (besides the point data itself) can be
covered by the helper function.
Fixed the 3 cases where such offset was present to use the proper checking helper
function.
Test cases added.
Fixed review comments.
Diffstat (limited to 'sql/spatial.h')
-rw-r--r-- | sql/spatial.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sql/spatial.h b/sql/spatial.h index 075ae0ecc89..60a34852178 100644 --- a/sql/spatial.h +++ b/sql/spatial.h @@ -335,14 +335,17 @@ protected: Need to perform the calculation in logical units, since multiplication can overflow the size data type. - @arg data pointer to the begining of the points array - @arg expected_points number of points expected + @arg data pointer to the begining of the points array + @arg expected_points number of points expected + @arg extra_point_space extra space for each point element in the array @return true if there are not enough points */ - inline bool not_enough_points(const char *data, uint32 expected_points) const + inline bool not_enough_points(const char *data, uint32 expected_points, + uint32 extra_point_space = 0) const { return (m_data_end < data || - (expected_points > ((m_data_end - data) / POINT_DATA_SIZE))); + (expected_points > ((m_data_end - data) / + (POINT_DATA_SIZE + extra_point_space)))); } const char *m_data; const char *m_data_end; |