diff --git a/STATUS b/STATUS index a448bc608e..a2420d875a 100644 --- a/STATUS +++ b/STATUS @@ -116,13 +116,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK: 2.4.x patch: trunk patches apply (minus CHANGES for 1448171) 2.4.x cumulative patch: http://people.apache.org/~jailletc36/backport5.patch (minus CHANGES for 1448171) +1: jailletc36, igalic, jim - - * ssl_util_ssl: Speed up logging function by x4 using ap_bin2hex intoduced in 2.4.4 - It will be in lowercase instead of uppercase, but it is only for logging. I don't think this is a real issue. - trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1429559 - http://svn.apache.org/viewvc?view=revision&revision=1451484 - 2.4.x patch: trunk patch applies with offset. - +1: jailletc36, humbedooh, jim PATCHES PROPOSED TO BACKPORT FROM TRUNK: [ New proposals should be added at the end of the list ] diff --git a/modules/ssl/ssl_util_ssl.c b/modules/ssl/ssl_util_ssl.c index 48b561dc3b..b969b41551 100644 --- a/modules/ssl/ssl_util_ssl.c +++ b/modules/ssl/ssl_util_ssl.c @@ -479,14 +479,15 @@ int SSL_CTX_use_certificate_chain( char *SSL_SESSION_id2sz(unsigned char *id, int idlen, char *str, int strsize) { - char *cp; - int n; + if (idlen > SSL_MAX_SSL_SESSION_ID_LENGTH) + idlen = SSL_MAX_SSL_SESSION_ID_LENGTH; + + /* We must ensure not to process more than what would fit in the + * destination buffer, including terminating NULL */ + if (idlen > (strsize-1) / 2) + idlen = (strsize-1) / 2; + + ap_bin2hex(id, idlen, str); - cp = str; - for (n = 0; n < idlen && n < SSL_MAX_SSL_SESSION_ID_LENGTH; n++) { - apr_snprintf(cp, strsize - (cp-str), "%02X", id[n]); - cp += 2; - } - *cp = NUL; return str; }