$OpenBSD: patch-items_c,v 1.7 2014/07/15 18:17:06 giovanni Exp $

printf format string fix for long long time_t

and fix buffer-overrun when logging keys (CVE-2013-0179)
https://github.com/memcached/memcached/commit/fbe823d9a61b5149cd6e3b5e17bd28dd3b8dd760

--- items.c.orig	Fri May  2 00:10:56 2014
+++ items.c	Mon Jul 14 00:10:07 2014
@@ -410,9 +410,9 @@ char *do_item_cachedump(const unsigned int slabs_clsid
         /* Copy the key since it may not be null-terminated in the struct */
         strncpy(key_temp, ITEM_key(it), it->nkey);
         key_temp[it->nkey] = 0x00; /* terminate */
-        len = snprintf(temp, sizeof(temp), "ITEM %s [%d b; %lu s]\r\n",
+        len = snprintf(temp, sizeof(temp), "ITEM %s [%d b; %llu s]\r\n",
                        key_temp, it->nbytes - 2,
-                       (unsigned long)it->exptime + process_started);
+                       (unsigned long long)it->exptime + process_started);
         if (bufcurr + len + 6 > memlimit)  /* 6 is END\r\n\0 */
             break;
         memcpy(buffer + bufcurr, temp, len);
