From 9fe84d4ad1ec1eae6bcf44b4067b948d9a16e4dc Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Fri, 28 Jul 2017 09:31:16 +0200 Subject: [PATCH] http_client: use strcpy() instead of strncpy() with sizeof dest buffer - padding the rest of dest buffer with 0 is inneficient --- src/modules/http_client/functions.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/modules/http_client/functions.c b/src/modules/http_client/functions.c index c4fc39d6a4..1bdae25df7 100644 --- a/src/modules/http_client/functions.c +++ b/src/modules/http_client/functions.c @@ -344,16 +344,14 @@ static int curL_query_url(struct sip_msg* _m, const char* _url, str* _dst, LM_DBG("We received Content-Type: %s\n", ct); if (params->pconn && strlen(ct)pconn->result_content_type)-1) { - strncpy(params->pconn->result_content_type, ct, - sizeof(params->pconn->result_content_type)); + strcpy(params->pconn->result_content_type, ct); } } if(url) { LM_DBG("We visited URL: %s\n", url); if (params->pconn && strlen(url)pconn->redirecturl)-1) { - strncpy(params->pconn->redirecturl, url , - sizeof(params->pconn->redirecturl)); + strcpy(params->pconn->redirecturl, url); } } } -- 2.20.1