Download | Plain Text | No Line Numbers


  1. diff -Naur a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
  2. --- a/sapi/fpm/fpm/fpm_main.c 2020-07-24 12:31:20.340344624 +0200
  3. +++ b/sapi/fpm/fpm/fpm_main.c 2020-07-24 12:31:56.755065935 +0200
  4. @@ -1351,7 +1351,6 @@
  5. int *mode = (int *)arg;
  6. char *key;
  7. char *value = NULL;
  8. - struct key_value_s kv;
  9.  
  10. if (!mode || !arg1) return;
  11.  
  12. @@ -1362,7 +1361,7 @@
  13.  
  14. key = Z_STRVAL_P(arg1);
  15.  
  16. - if (!key || strlen(key) < 1) {
  17. + if (!key || Z_STRLEN_P(arg1) < 1) {
  18. zlog(ZLOG_ERROR, "Passing INI directive through FastCGI: empty key");
  19. return;
  20. }
  21. @@ -1376,10 +1375,8 @@
  22. return;
  23. }
  24.  
  25. - kv.key = key;
  26. - kv.value = value;
  27. - kv.next = NULL;
  28. - if (fpm_php_apply_defines_ex(&kv, *mode) == -1) {
  29. + // zend_string of arg2 is marked persistent but releasing doesn't know. so pass the internal char*
  30. + if (zend_alter_ini_entry_chars(Z_STR_P(arg1), value, Z_STRLEN_P(arg2), *mode, PHP_INI_STAGE_HTACCESS) == FAILURE) {
  31. zlog(ZLOG_ERROR, "Passing INI directive through FastCGI: unable to set '%s'", key);
  32. }
  33. }
  34.