]> granicus.if.org Git - apache/commitdiff
* modules/ssl/ssl_scache_memcache.c (mc_session_id2sz): Fix memcache
authorJoe Orton <jorton@apache.org>
Tue, 26 Feb 2008 15:25:51 +0000 (15:25 +0000)
committerJoe Orton <jorton@apache.org>
Tue, 26 Feb 2008 15:25:51 +0000 (15:25 +0000)
  key id generation by passing the correct length to snprintf (it
  was NUL terminating at the second byte with len=2);

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@631254 13f79535-47bb-0310-9956-ffa450edef68

modules/ssl/ssl_scache_memcache.c

index ed7a5c5260da99e69daacb5ad1ae5394f7339462..52917e29caa4bbe61fc7346f05384780ccfef9fb 100644 (file)
@@ -181,7 +181,7 @@ static char *mc_session_id2sz(const unsigned char *id, int idlen,
 
     cp = apr_cpystrn(str, MC_TAG, MC_TAG_LEN);
     for (n = 0; n < idlen && n < maxlen; n++) {
-        apr_snprintf(cp, 2, "%02X", id[n]);
+        apr_snprintf(cp, 3, "%02X", (unsigned) id[n]);
         cp += 2;
     }