Credit to OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2589
Credit to OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2590
Credit to OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2591
Credit to OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2592
(References #3895)
git-svn-id: http://svn.osgeo.org/postgis/branches/2.4@15960
b70326c6-7e19-0410-871a-
916f4a2858ee
- #3874, lw_dist2d_pt_arc division by zero
- #3882, undefined behaviour in zigzag with negative inputs
- #3891, undefined behaviour in pointarray_to_encoded_polyline
+ - #3895, throw error on malformed WKB input
PostGIS 2.4.0
size_t pa_size;
uint32_t ndims = 2;
uint32_t npoints = 0;
+ static uint32_t maxpoints = 4294967295 / WKB_DOUBLE_SIZE / 4;
/* Calculate the size of this point array. */
npoints = integer_from_wkb_state(s);
+ if (npoints > maxpoints)
+ {
+ lwerror("point array length (%d) is too large");
+ }
LWDEBUGF(4,"Pointarray has %d points", npoints);