From: Nick Mathewson Date: Fri, 14 May 2010 18:36:49 +0000 (-0400) Subject: Replace (safe) use of strcpy with memcpy to appease OpenBSD X-Git-Tag: release-2.0.6-rc~64 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=caca2f451c3ecc97745f578bae9b4ad40145d84d;p=libevent Replace (safe) use of strcpy with memcpy to appease OpenBSD If Libevent uses strcpy, even safely, it seems OpenBSD's linker will complain every time a library links Libevent. It's easier just not to use the old thing, even when it's safe to do so. --- diff --git a/http.c b/http.c index 5d3631fc..c4fb09c5 100644 --- a/http.c +++ b/http.c @@ -249,9 +249,9 @@ evhttp_htmlescape(const char *html) } for (i = 0; i < old_size; ++i) { const char *replaced = html_replace(html[i], scratch_space); - /* this is length checked */ - strcpy(p, replaced); - p += strlen(replaced); + size_t len = strlen(replaced); + memcpy(p, replaced, len); + p += len; } *p = '\0';