httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kbr...@apache.org
Subject svn commit: r1228816 - in /httpd/httpd/trunk/modules/ssl: ssl_util_ssl.c ssl_util_ssl.h
Date Sun, 08 Jan 2012 10:08:19 GMT
Author: kbrand
Date: Sun Jan  8 10:08:19 2012
New Revision: 1228816

URL: http://svn.apache.org/viewvc?rev=1228816&view=rev
Log:
fix signedness issue with SSL_X509_NAME_to_string()'s maxlen argument

Modified:
    httpd/httpd/trunk/modules/ssl/ssl_util_ssl.c
    httpd/httpd/trunk/modules/ssl/ssl_util_ssl.h

Modified: httpd/httpd/trunk/modules/ssl/ssl_util_ssl.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_util_ssl.c?rev=1228816&r1=1228815&r2=1228816&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_util_ssl.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_util_ssl.c Sun Jan  8 10:08:19 2012
@@ -260,7 +260,7 @@ char *SSL_X509_NAME_ENTRY_to_string(apr_
  * convert an X509_NAME to an RFC 2253 formatted string, optionally truncated
  * to maxlen characters (specify a maxlen of 0 for no length limit)
  */
-char *SSL_X509_NAME_to_string(apr_pool_t *p, X509_NAME *dn, unsigned int maxlen)
+char *SSL_X509_NAME_to_string(apr_pool_t *p, X509_NAME *dn, int maxlen)
 {
     char *result = NULL;
     BIO *bio;
@@ -271,8 +271,8 @@ char *SSL_X509_NAME_to_string(apr_pool_t
     X509_NAME_print_ex(bio, dn, 0, XN_FLAG_RFC2253);
     len = BIO_pending(bio);
     if (len > 0) {
-        result = apr_palloc(p, maxlen ? maxlen+1 : len+1);
-        if (maxlen && maxlen < len) {
+        result = apr_palloc(p, (maxlen > 0) ? maxlen+1 : len+1);
+        if (maxlen > 0 && maxlen < len) {
             len = BIO_read(bio, result, maxlen);
             if (maxlen > 2) {
                 /* insert trailing ellipsis if there's enough space */

Modified: httpd/httpd/trunk/modules/ssl/ssl_util_ssl.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_util_ssl.h?rev=1228816&r1=1228815&r2=1228816&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_util_ssl.h (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_util_ssl.h Sun Jan  8 10:08:19 2012
@@ -66,7 +66,7 @@ int         SSL_smart_shutdown(SSL *ssl)
 BOOL        SSL_X509_isSGC(X509 *);
 BOOL        SSL_X509_getBC(X509 *, int *, int *);
 char       *SSL_X509_NAME_ENTRY_to_string(apr_pool_t *p, X509_NAME_ENTRY *xsne);
-char       *SSL_X509_NAME_to_string(apr_pool_t *, X509_NAME *, unsigned int);
+char       *SSL_X509_NAME_to_string(apr_pool_t *, X509_NAME *, int);
 BOOL        SSL_X509_getIDs(apr_pool_t *, X509 *, apr_array_header_t **);
 BOOL        SSL_X509_INFO_load_file(apr_pool_t *, STACK_OF(X509_INFO) *, const char *);
 BOOL        SSL_X509_INFO_load_path(apr_pool_t *, STACK_OF(X509_INFO) *, const char *);



Mime
View raw message