[postgis-tickets] r15963 - Fix up return type
Paul Ramsey
pramsey at cleverelephant.ca
Tue Oct 10 15:54:15 PDT 2017
Author: pramsey
Date: 2017-10-10 15:54:15 -0700 (Tue, 10 Oct 2017)
New Revision: 15963
Modified:
trunk/liblwgeom/lwin_wkb.c
Log:
Fix up return type
Modified: trunk/liblwgeom/lwin_wkb.c
===================================================================
--- trunk/liblwgeom/lwin_wkb.c 2017-10-10 22:51:02 UTC (rev 15962)
+++ trunk/liblwgeom/lwin_wkb.c 2017-10-10 22:54:15 UTC (rev 15963)
@@ -28,6 +28,7 @@
#include "liblwgeom_internal.h" /* NOTE: includes lwgeom_log.h */
#include "lwgeom_log.h"
#include <math.h>
+#include <limits.h>
/**
* Used for passing the parse state between the parsing functions.
@@ -335,14 +336,14 @@
size_t pa_size;
uint32_t ndims = 2;
uint32_t npoints = 0;
- static uint32_t maxpoints = 4294967295 / WKB_DOUBLE_SIZE / 4;
+ static uint32_t maxpoints = UINT_MAX / WKB_DOUBLE_SIZE / 4;
/* Calculate the size of this point array. */
npoints = integer_from_wkb_state(s);
if (npoints > maxpoints)
{
lwerror("Pointarray length (%d) is too large");
- return;
+ return NULL;
}
LWDEBUGF(4,"Pointarray has %d points", npoints);
More information about the postgis-tickets
mailing list