Hi!

Please see attached patch.

Cheers, Mattias.

On Wed, Aug 08, 2007 at 02:18:42AM +0400, Antony Dovgal wrote:
> Two OpenSSL tests started to fail yesterday:
> 
> # cat ext/openssl/tests/004.diff
> 009+ Warning: openssl_csr_new(): add_entry_by_txt countryNam -> AU (failed) 
> in /local/qa/5_2/ext/openssl/tests/004.php on line 7
> 009- Warning: openssl_csr_new(): add1_attr_by_txt challengePassword_min -> 
> 4 (failed) in %s on line %d
> 011+
> 012+ Warning: openssl_csr_new(): add_entry_by_txt countryNam -> AU (failed) 
> in /local/qa/5_2/ext/openssl/tests/004.php on line 12
> 013+ bool(false)
> 011- resource(%d) of type (OpenSSL X.509 CSR)
> 
> 
> 
> # cat ext/openssl/tests/bug36732.diff
> 001+ Warning: openssl_csr_new(): add_entry_by_txt countryNam -> AU (failed) 
> in /local/qa/5_2/ext/openssl/tests/bug36732.php on line 16
> 002+
> 001- Ok
> 002- Ok
> 003+ Warning: openssl_csr_sign(): cannot get CSR from parameter 1 in 
> /local/qa/5_2/ext/openssl/tests/bug36732.php on line 17
> 004+
> 005+ Warning: openssl_csr_export() expects parameter 1 to be resource, 
> boolean given in /local/qa/5_2/ext/openssl/tests/bug36732.php on line 20
> 006+
> 007+ Warning: openssl_x509_export(): cannot get cert from parameter 1 in 
> /local/qa/5_2/ext/openssl/tests/bug36732.php on line 25
> 
> 
> On 06.08.2007 23:50, Pierre-Alain Joye wrote:
> >pajoye               Mon Aug  6 19:50:16 2007 UTC
> >
> >  Modified files:              
> >    /php-src/ext/openssl     openssl.c 
> >  Log:
> >  - MFB: #42222, forgot this one (thanks mattias)
> >  
> >http://cvs.php.net/viewvc.cgi/php-src/ext/openssl/openssl.c?r1=1.147&r2=1.148&diff_format=u
> >Index: php-src/ext/openssl/openssl.c
> >diff -u php-src/ext/openssl/openssl.c:1.147 
> >php-src/ext/openssl/openssl.c:1.148
> >--- php-src/ext/openssl/openssl.c:1.147      Mon Aug  6 19:13:05 2007
> >+++ php-src/ext/openssl/openssl.c    Mon Aug  6 19:50:16 2007
> >@@ -20,7 +20,7 @@
> >    +----------------------------------------------------------------------+
> >  */
> > 
> >-/* $Id: openssl.c,v 1.147 2007/08/06 19:13:05 pajoye Exp $ */
> >+/* $Id: openssl.c,v 1.148 2007/08/06 19:50:16 pajoye Exp $ */
> > 
> > #ifdef HAVE_CONFIG_H
> > #include "config.h"
> >@@ -1818,9 +1818,10 @@
> >                             len = 200;
> >                     }
> >                     memcpy(buffer, type, len);
> >-                    buffer[len] = '\0';
> >+                    buffer[len - 1] = '\0';
> >+
> >                     type = buffer;
> >-            
> >+
> >                     /* Skip past any leading X. X: X, etc to allow for 
> >                     multiple
> >                      * instances */
> >                     for (str = type; *str; str++) {
> >
> 
> 
> -- 
> Wbr, 
> Antony Dovgal
> 
> -- 
> PHP CVS Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
Index: ext/openssl/openssl.c
===================================================================
RCS file: /repository/php-src/ext/openssl/openssl.c,v
retrieving revision 1.98.2.5.2.40
diff -u -a -r1.98.2.5.2.40 openssl.c
--- ext/openssl/openssl.c       6 Aug 2007 19:49:45 -0000       1.98.2.5.2.40
+++ ext/openssl/openssl.c       8 Aug 2007 06:19:40 -0000
@@ -1726,7 +1726,7 @@
                /* Finally apply defaults from config file */
                for(i = 0; i < sk_CONF_VALUE_num(dn_sk); i++) {
                        int len;
-                       char buffer[200];
+                       char buffer[200 + 1];
                        
                        v = sk_CONF_VALUE_value(dn_sk, i);
                        type = v->name;
@@ -1743,7 +1743,7 @@
                                len = 200;
                        }
                        memcpy(buffer, type, len);
-                       buffer[len - 1] = '\0';
+                       buffer[len] = '\0';
                        type = buffer;
                
                        /* Skip past any leading X. X: X, etc to allow for 
multiple

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to