openbsd-ports/misc/memcached/patches/patch-items_c
jasper 4c60f3ab4b - update memcached to 1.4.0 ("many improvements have been made, upgrading is
recommended")

from Scott Vokes (MAINTAINER), thanks
2009-08-07 10:46:41 +00:00

22 lines
946 B
Plaintext

$OpenBSD: patch-items_c,v 1.3 2009/08/07 10:46:41 jasper Exp $
--- items.c.orig Thu Jul 9 12:43:42 2009
+++ items.c Sat Jul 11 10:54:34 2009
@@ -379,7 +379,7 @@ char *do_item_cachedump(const unsigned int slabs_clsid
(unsigned long)it->exptime + process_started);
if (bufcurr + len + 6 > memlimit) /* 6 is END\r\n\0 */
break;
- strcpy(buffer + bufcurr, temp);
+ strlcpy(buffer + bufcurr, temp, sizeof(buffer) - bufcurr);
bufcurr += len;
shown++;
it = it->next;
@@ -446,7 +446,7 @@ void do_item_stats_sizes(ADD_STAT add_stats, void *c)
if (histogram[i] != 0) {
char key[8];
int klen = 0;
- klen = sprintf(key, "%d", i * 32);
+ klen = snprintf(key, 8, "%d", i * 32);
assert(klen < sizeof(key));
APPEND_STAT(key, "%u", histogram[i]);
}