]> granicus.if.org Git - postgis/commitdiff
geohash_point_as_int: Fix undefined behaviour in shift operation
authorPaul Ramsey <pramsey@cleverelephant.ca>
Fri, 6 Oct 2017 13:21:23 +0000 (13:21 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Fri, 6 Oct 2017 13:21:23 +0000 (13:21 +0000)
References #3875

git-svn-id: http://svn.osgeo.org/postgis/branches/2.3@15920 b70326c6-7e19-0410-871a-916f4a2858ee

NEWS
liblwgeom/lwalgorithm.c

diff --git a/NEWS b/NEWS
index 8ede411f88199c3efe7aff21b354f2afaa8333b5..a28329eb02931a4937f4f5a6cf0d6ca630378acd 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -28,6 +28,7 @@ PostGIS 2.3.4
   - #3879, Division by zero in some arc cases
   - #3878, Single defn of signum in header
   - #3880, Undefined behaviour in TYPMOD_GET_SRID
+  - #3875, Fix undefined behaviour in shift operation
 
 
 PostGIS 2.3.3
index 726f729f0810ea130551e5c31c9894caf202cde8..19163e310418b6312c681b2d12fb2fadf330629e 100644 (file)
@@ -666,7 +666,7 @@ unsigned int geohash_point_as_int(POINT2D *pt)
                        mid = (lon[0] + lon[1]) / 2;
                        if (longitude > mid)
                        {
-                               ch |= 0x0001 << bit;
+                               ch |= 0x0001u << bit;
                                lon[0] = mid;
                        }
                        else