[postgis-tickets] [SCM] PostGIS branch master updated. 3.1.0alpha2-34-g7b7e66a

git at osgeo.org git at osgeo.org
Fri Jul 31 02:33:37 PDT 2020


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  7b7e66ae6e8438e125ceda7e413eb141e462b571 (commit)
      from  626556b359e39ef94f24f14e28621860b866283a (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 7b7e66ae6e8438e125ceda7e413eb141e462b571
Author: Raúl Marín <git at rmr.ninja>
Date:   Fri Jul 31 11:32:48 2020 +0200

    Cunit: Avoid crashing when comparing NULL strings
    
    References #4733

diff --git a/liblwgeom/cunit/cu_tester.h b/liblwgeom/cunit/cu_tester.h
index baa5e62..3cd0c13 100644
--- a/liblwgeom/cunit/cu_tester.h
+++ b/liblwgeom/cunit/cu_tester.h
@@ -40,11 +40,21 @@ typedef void (*PG_SuiteSetup)(void);
   CU_ASSERT_EQUAL(o,e); \
 } while (0);
 
-#define ASSERT_STRING_EQUAL(o,e) do { \
-  if ( strcmp(o,e) != 0 ) \
-    fprintf(stderr, "[%s:%d]\n Expected: %s\n Obtained: %s\n", __FILE__, __LINE__, (e), (o)); \
-  CU_ASSERT_STRING_EQUAL(o,e); \
-} while (0);
+#define ASSERT_STRING_EQUAL(o, e) \
+	do \
+	{ \
+		if ((!(o) && (e)) || (!(e) && (o)) || strcmp((o), (e)) != 0) \
+		{ \
+			fprintf(stderr, \
+				"[%s:%d]\n Expected: %s\n Obtained: %s\n", \
+				__FILE__, \
+				__LINE__, \
+				(e) ? (e) : "NULL", \
+				(o) ? (o) : "NULL"); \
+			CU_FAIL(); \
+		} \
+		CU_PASS(); \
+	} while (0);
 
 #define ASSERT_VARLENA_EQUAL(v, s) \
 	do \

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

Summary of changes:
 liblwgeom/cunit/cu_tester.h | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list