summaryrefslogtreecommitdiffstats
path: root/11.patch
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2025-07-31 10:42:07 +0200
committerRemi Collet <remi@php.net>2025-07-31 10:42:07 +0200
commitc1503b10626b78b063996e8b58b654373b05b13a (patch)
treed0209ec31452a9f515034411ea6009ec2822f577 /11.patch
parentad922b9a6cad49ebcae8a29e08fee61e45aac067 (diff)
fix behavior change with librnp 0.18 using patch fromHEADmaster
https://github.com/rnpgp/php-rnp/pull/11 fix segfault in php_rnp_password_callback using patch from https://github.com/rnpgp/php-rnp/pull/13 re-license spec file to CECILL-2.1
Diffstat (limited to '11.patch')
-rw-r--r--11.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/11.patch b/11.patch
new file mode 100644
index 0000000..d5a4e79
--- /dev/null
+++ b/11.patch
@@ -0,0 +1,35 @@
+From f32b3b4c0a77096d256b4635b7183fb6dc53461b Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Thu, 31 Jul 2025 10:09:23 +0200
+Subject: [PATCH] check input length for librnp 0.18
+
+---
+ rnp.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/rnp.c b/rnp.c
+index 0a41e03..632925b 100644
+--- a/rnp.c
++++ b/rnp.c
+@@ -330,6 +330,10 @@ PHP_FUNCTION(rnp_dump_packets)
+ Z_PARAM_LONG(flags)
+ ZEND_PARSE_PARAMETERS_END();
+
++ if (!ZSTR_LEN(input)) {
++ RETURN_FALSE;
++ }
++
+ ret = rnp_input_from_memory(&mem_input, (uint8_t *)ZSTR_VAL(input), ZSTR_LEN(input), false);
+
+ if (ret != RNP_SUCCESS) {
+@@ -1938,6 +1942,10 @@ PHP_FUNCTION(rnp_import_keys)
+ Z_PARAM_LONG(flags)
+ ZEND_PARSE_PARAMETERS_END();
+
++ if (!ZSTR_LEN(input)) {
++ RETURN_FALSE;
++ }
++
+ pffi = Z_FFI_P(zffi);
+
+ ret = rnp_input_from_memory(&mem_input, (uint8_t *)ZSTR_VAL(input), ZSTR_LEN(input), false);