From d9630b2bec12ab6b41771eed19af0146d9dffa20 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 26 Feb 2008 15:25:51 +0000 Subject: [PATCH] * modules/ssl/ssl_scache_memcache.c (mc_session_id2sz): Fix memcache 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ssl/ssl_scache_memcache.c b/modules/ssl/ssl_scache_memcache.c index ed7a5c5260d..52917e29caa 100644 --- a/modules/ssl/ssl_scache_memcache.c +++ b/modules/ssl/ssl_scache_memcache.c @@ -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; } -- 2.47.2