From bebddcf233edb683aa4bb0dcf3ddb96ad06c6fd2 Mon Sep 17 00:00:00 2001 From: jboone100 Date: Thu, 4 Feb 2016 13:45:56 -0800 Subject: [PATCH 1/2] String issue in python 3 The call to PyModule_AddStringConstant was crashing in python 3 when compiled with the -fsanitize=address flag --- src/main/aerospike.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/aerospike.c b/src/main/aerospike.c index 89c65ea51..5ba63cd2e 100644 --- a/src/main/aerospike.c +++ b/src/main/aerospike.c @@ -76,11 +76,12 @@ AerospikeConstants operator_constants[] = { MOD_INIT(aerospike) { - static char version[6] = "1.0.61"; + char version[8]; // Makes things "thread-safe" PyEval_InitThreads(); int i = 0; + strcpy(version, "1.0.61"); // aerospike Module PyObject * aerospike; From ea5b12d9282c5c340759f863c3a107f7714475d7 Mon Sep 17 00:00:00 2001 From: jboone100 Date: Fri, 5 Feb 2016 11:12:09 -0800 Subject: [PATCH 2/2] A better fix to memory error. --- src/main/aerospike.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/aerospike.c b/src/main/aerospike.c index 5ba63cd2e..ac4fe38ba 100644 --- a/src/main/aerospike.c +++ b/src/main/aerospike.c @@ -76,12 +76,11 @@ AerospikeConstants operator_constants[] = { MOD_INIT(aerospike) { - char version[8]; + const char version[8] = "1.0.61"; // Makes things "thread-safe" PyEval_InitThreads(); int i = 0; - strcpy(version, "1.0.61"); // aerospike Module PyObject * aerospike;