-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Le 16/12/2015 14:41, Tom Sommer a écrit :
> Hi
> 
> I realise 7.0.1 is already out in RC1, but there is a bug in the 
> Litespeed 6.8 sapi which breaks php_flag and php_value. It's
> causing our customers a lot of headaches.
> 
> I see Litespeed 6.9 is already in master, but would it be possible
> to get backported into 7.0.1?
> 
> The fix is here: 
> https://github.com/php/php-src/commit/5bcb7a7019a49c2f80eda7d2aa947efe
beee0034#diff-e8087496f5a642ce83e5d655c08c6b3a
>
> 
(I believe)
> 
> Thanks

Missing in 7.0   see diff-7.0.txt
Missing in 7.0.1 see diff-7.0.1.txt


Remi

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlZyVHoACgkQYUppBSnxahhtRwCgl23H+rKJYFYTQV22pJ/olGV+
hucAoMcUYM8W/rQb/M91lfnUkWZI8tSL
=ofvT
-----END PGP SIGNATURE-----
diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c
index 13bca0c..ebaa91f 100644
--- a/sapi/litespeed/lsapi_main.c
+++ b/sapi/litespeed/lsapi_main.c
@@ -418,7 +418,7 @@ static void sapi_lsapi_log_message(char *message)
 static sapi_module_struct lsapi_sapi_module =
 {
     "litespeed",
-    "LiteSpeed V6.8",
+    "LiteSpeed V6.9",
 
     php_lsapi_startup,              /* startup */
     php_module_shutdown_wrapper,    /* shutdown */
@@ -602,11 +602,12 @@ static int alter_ini( const char * pKey, int keyLen, 
const char * pValue, int va
         else
                {
 #if PHP_MAJOR_VERSION >= 7
-                       psKey = zend_string_init(pKey, keyLen, 1);
+            --keyLen;
+            psKey = zend_string_init(pKey, keyLen, 1);
             zend_alter_ini_entry_chars(psKey,
                              (char *)pValue, valLen,
                              type, PHP_INI_STAGE_ACTIVATE);
-                       zend_string_release(psKey);
+            zend_string_release(psKey);
 #else
             zend_alter_ini_entry((char *)pKey, keyLen,
                              (char *)pValue, valLen,
@@ -770,6 +771,8 @@ static int cli_main( int argc, char * argv[] )
 
         zend_uv.html_errors = 0; /* tell the engine we're in non-html mode */
         CG(in_compilation) = 0; /* not initialized but needed for several 
options */
+        SG(options) |= SAPI_OPTION_NO_CHDIR;
+        
 #if PHP_MAJOR_VERSION < 7
         EG(uninitialized_zval_ptr) = NULL;
 #endif
@@ -1247,7 +1250,7 @@ PHP_FUNCTION(apache_get_modules)
 {
     static const char * mod_names[] =
     {
-        "mod_rewrite", "mod_mime", "mod_headers", "mod_expires", NULL
+        "mod_rewrite", "mod_mime", "mod_headers", "mod_expires", 
"mod_auth_basic", NULL
     };
     const char **name = mod_names;
     /* TODO: */
diff --git a/sapi/litespeed/lsapilib.c b/sapi/litespeed/lsapilib.c
index 6abaf0d..a542771 100644
--- a/sapi/litespeed/lsapilib.c
+++ b/sapi/litespeed/lsapilib.c
@@ -1499,7 +1499,7 @@ int LSAPI_ReqBodyGetLine_r( LSAPI_Request * pReq, char * 
pBuf, size_t bufLen, in
     char * pBufCur = pBuf;
     char * pCur;
     char * p;
-    if (!pReq || (pReq->m_fd ==-1) ||( !pBuf )|| !getLF )
+    if (!pReq || (pReq->m_fd ==-1) ||( !pBuf )||(bufLen < 0 )|| !getLF )
         return -1;
     *getLF = 0;
     while( (left = pBufEnd - pBufCur ) > 0 )
@@ -1543,7 +1543,7 @@ ssize_t LSAPI_ReadReqBody_r( LSAPI_Request * pReq, char * 
pBuf, size_t bufLen )
     ssize_t len;
     off_t total;
     /* char *pOldBuf = pBuf; */
-    if (!pReq || (pReq->m_fd ==-1) || ( !pBuf ))
+    if (!pReq || (pReq->m_fd ==-1) || ( !pBuf )||(bufLen < 0 ))
         return -1;
 
     total = pReq->m_reqBodyLen - pReq->m_reqBodyRead;
diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c
index 0c9ea49..ebaa91f 100644
--- a/sapi/litespeed/lsapi_main.c
+++ b/sapi/litespeed/lsapi_main.c
@@ -602,11 +602,12 @@ static int alter_ini( const char * pKey, int keyLen, 
const char * pValue, int va
         else
                {
 #if PHP_MAJOR_VERSION >= 7
-                       psKey = zend_string_init(pKey, keyLen, 1);
+            --keyLen;
+            psKey = zend_string_init(pKey, keyLen, 1);
             zend_alter_ini_entry_chars(psKey,
                              (char *)pValue, valLen,
                              type, PHP_INI_STAGE_ACTIVATE);
-                       zend_string_release(psKey);
+            zend_string_release(psKey);
 #else
             zend_alter_ini_entry((char *)pKey, keyLen,
                              (char *)pValue, valLen,
diff --git a/sapi/litespeed/lsapilib.c b/sapi/litespeed/lsapilib.c
index 6abaf0d..a542771 100644
--- a/sapi/litespeed/lsapilib.c
+++ b/sapi/litespeed/lsapilib.c
@@ -1499,7 +1499,7 @@ int LSAPI_ReqBodyGetLine_r( LSAPI_Request * pReq, char * 
pBuf, size_t bufLen, in
     char * pBufCur = pBuf;
     char * pCur;
     char * p;
-    if (!pReq || (pReq->m_fd ==-1) ||( !pBuf )|| !getLF )
+    if (!pReq || (pReq->m_fd ==-1) ||( !pBuf )||(bufLen < 0 )|| !getLF )
         return -1;
     *getLF = 0;
     while( (left = pBufEnd - pBufCur ) > 0 )
@@ -1543,7 +1543,7 @@ ssize_t LSAPI_ReadReqBody_r( LSAPI_Request * pReq, char * 
pBuf, size_t bufLen )
     ssize_t len;
     off_t total;
     /* char *pOldBuf = pBuf; */
-    if (!pReq || (pReq->m_fd ==-1) || ( !pBuf ))
+    if (!pReq || (pReq->m_fd ==-1) || ( !pBuf )||(bufLen < 0 ))
         return -1;
 
     total = pReq->m_reqBodyLen - pReq->m_reqBodyRead;
-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to