[SCM] PostGIS branch master updated. 3.5.0-40-gb32c5c120

git at osgeo.org git at osgeo.org
Tue Oct 29 15:19:34 PDT 2024


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, master has been updated
       via  b32c5c120d7ba40801b27b947337d9da509ca799 (commit)
       via  bdfdde58faca8e99e34f4cefd9e52b2b96167254 (commit)
      from  56622d9599fbf5088c21c85145804a2d865981b7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit b32c5c120d7ba40801b27b947337d9da509ca799
Merge: 56622d959 bdfdde58f
Author: pramsey <pramsey at cleverelephant.ca>
Date:   Tue Oct 29 15:19:33 2024 -0700

    Merge pull request 'Fix undefined behavior in p_int using int64_t' (!221) from lbartoletti/postgis:fix_mvt_undefined_behaviour into master
    
    Reviewed-on: https://git.osgeo.org/gitea/postgis/postgis/pulls/221


commit bdfdde58faca8e99e34f4cefd9e52b2b96167254
Author: Loïc Bartoletti <loic.bartoletti at oslandia.com>
Date:   Fri Sep 27 09:17:48 2024 +0200

    Fix undefined behavior in p_int using int64_t
    
    Resolve undefined behavior when shifting 32-bit value by 31 bits.
    Use int64_t for the right shift operation to ensure defined behavior
    while maintaining original functionality and passing all tests.

diff --git a/postgis/mvt.c b/postgis/mvt.c
index 85ee75305..14691b551 100644
--- a/postgis/mvt.c
+++ b/postgis/mvt.c
@@ -144,7 +144,7 @@ static inline uint32_t c_int(enum mvt_cmd_id id, uint32_t count)
 
 static inline uint32_t p_int(int32_t value)
 {
-	return (value << 1) ^ (value >> 31);
+	return (value << 1) ^ ((int64_t)value >> 31);
 }
 
 static uint32_t encode_ptarray(enum mvt_type type, POINTARRAY *pa, uint32_t *buffer, int32_t *px, int32_t *py)

-----------------------------------------------------------------------

Summary of changes:
 postgis/mvt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list