summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorKent Boortz <kent.boortz@oracle.com>2011-06-30 21:27:04 +0200
committerKent Boortz <kent.boortz@oracle.com>2011-06-30 21:27:04 +0200
commit7087c2e689fb49578ae3cac487050a05ffbf894c (patch)
treefc80c87480163233b10b7e9d6b64678df3a4f872 /sql
parente5ce023f5716212aa1d20c757ebc8c6cecdf055a (diff)
parent095a91756c7ff794f74e993a57d6b1aa7f56f99f (diff)
downloadmariadb-git-7087c2e689fb49578ae3cac487050a05ffbf894c.tar.gz
Updated/added copyright headers
Diffstat (limited to 'sql')
-rw-r--r--sql/spatial.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/sql/spatial.cc b/sql/spatial.cc
index 7210814d5bd..2b690855a31 100644
--- a/sql/spatial.cc
+++ b/sql/spatial.cc
@@ -1,5 +1,4 @@
-/* Copyright (c) 2002-2007 MySQL AB, 2009 Sun Microsystems, Inc.
- Use is subject to license terms.
+/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -520,7 +519,7 @@ uint Gis_line_string::init_from_wkb(const char *wkb, uint len,
n_points= wkb_get_uint(wkb, bo);
proper_length= 4 + n_points * POINT_DATA_SIZE;
- if (len < proper_length || res->reserve(proper_length))
+ if (!n_points || len < proper_length || res->reserve(proper_length))
return 0;
res->q_append(n_points);
@@ -738,7 +737,9 @@ uint Gis_polygon::init_from_wkb(const char *wkb, uint len, wkbByteOrder bo,
if (len < 4)
return 0;
- n_linear_rings= wkb_get_uint(wkb, bo);
+ if (!(n_linear_rings= wkb_get_uint(wkb, bo)))
+ return 0;
+
if (res->reserve(4, 512))
return 0;
wkb+= 4;