summaryrefslogtreecommitdiffstats
path: root/126.patch
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2018-06-28 11:52:49 +0200
committerRemi Collet <remi@remirepo.net>2018-06-28 11:52:49 +0200
commit4a510a44ed6ac32ba1f571ad46fbc790144f7ac7 (patch)
tree70c0b04b9a0b25d2b1d61ebbbb5af34f67ee51ca /126.patch
parent6695f4307ff4353ed469d2aaec190059cf57d85b (diff)
add patch for [-Werror=format-security] from https://github.com/datastax/php-driver/pull/126
Diffstat (limited to '126.patch')
-rw-r--r--126.patch66
1 files changed, 66 insertions, 0 deletions
diff --git a/126.patch b/126.patch
new file mode 100644
index 0000000..dadc618
--- /dev/null
+++ b/126.patch
@@ -0,0 +1,66 @@
+From 0d6814525ebf7c8d45ad951f07aea9b6d54ccad7 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Thu, 28 Jun 2018 11:34:58 +0200
+Subject: [PATCH 1/2] fix build error [-Werror=format-security]
+
+---
+ ext/src/FutureSession.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/ext/src/FutureSession.c b/ext/src/FutureSession.c
+index 408297c1..3c622f6e 100644
+--- a/ext/src/FutureSession.c
++++ b/ext/src/FutureSession.c
+@@ -37,7 +37,7 @@ PHP_METHOD(FutureSession, get)
+
+ if (self->exception_message) {
+ zend_throw_exception_ex(exception_class(self->exception_code),
+- self->exception_code TSRMLS_CC, self->exception_message);
++ self->exception_code TSRMLS_CC, "%s", self->exception_message);
+ return;
+ }
+
+@@ -71,7 +71,7 @@ PHP_METHOD(FutureSession, get)
+ }
+
+ zend_throw_exception_ex(exception_class(self->exception_code),
+- self->exception_code TSRMLS_CC, self->exception_message);
++ self->exception_code TSRMLS_CC, "%s", self->exception_message);
+ return;
+ }
+
+
+From fd60ca80f16f7cff098cc637c91cf9188a033c2e Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Thu, 28 Jun 2018 11:44:56 +0200
+Subject: [PATCH 2/2] fix some build warnings [-WFormat]
+
+---
+ ext/php_driver.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/ext/php_driver.c b/ext/php_driver.c
+index b9663f8d..14b7a31d 100644
+--- a/ext/php_driver.c
++++ b/ext/php_driver.c
+@@ -325,7 +325,7 @@ throw_invalid_argument(zval *object,
+ if (cls_name) {
+ zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0 TSRMLS_CC,
+ "%s must be %s, an instance of %.*s given",
+- object_name, expected_type, cls_len, cls_name);
++ object_name, expected_type, (int)cls_len, cls_name);
+ #if PHP_MAJOR_VERSION >= 7
+ zend_string_release(str);
+ #else
+@@ -367,7 +367,11 @@ PHP_INI_MH(OnUpdateLogLevel)
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE,
+ PHP_DRIVER_NAME " | Unknown log level '%s', using 'ERROR'",
++#if PHP_MAJOR_VERSION >= 7
++ ZSTR_VAL(new_value));
++#else
+ new_value);
++#endif
+ cass_log_set_level(CASS_LOG_ERROR);
+ }
+ }