From: Paul Ramsey Date: Fri, 6 Oct 2017 13:21:18 +0000 (+0000) Subject: geohash_point_as_int: Fix undefined behaviour in shift operation X-Git-Tag: 2.4.1~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5e9dc8324be26a1ceca4c5339b8cc3f017f96069;p=postgis geohash_point_as_int: Fix undefined behaviour in shift operation References #3875 git-svn-id: http://svn.osgeo.org/postgis/branches/2.4@15919 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/NEWS b/NEWS index 0e632ca9c..e19eaea2f 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,7 @@ YYYY/MM/DD - #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.4.0 diff --git a/liblwgeom/lwalgorithm.c b/liblwgeom/lwalgorithm.c index 69b818a78..27096e80d 100644 --- a/liblwgeom/lwalgorithm.c +++ b/liblwgeom/lwalgorithm.c @@ -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