From: Jaroslav Kysela Date: Mon, 23 May 2016 19:35:58 +0000 (+0200) Subject: http: http_nonce_exists - fix possible string overflow - coverity X-Git-Tag: v4.2.1~476 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=86e1f022e2928f87d8f5e58ced399eaf8ad9f79c;p=thirdparty%2Ftvheadend.git http: http_nonce_exists - fix possible string overflow - coverity --- diff --git a/src/http.c b/src/http.c index 2525ac4ff..b62ed9137 100644 --- a/src/http.c +++ b/src/http.c @@ -280,7 +280,8 @@ http_nonce_exists(const char *nonce) if (nonce == NULL) return 0; - strcpy(tmp.nonce, nonce); + strncpy(tmp.nonce, nonce, sizeof(tmp.nonce)-1); + tmp.nonce[sizeof(tmp.nonce)-1] = '\0'; pthread_mutex_lock(&global_lock); n = RB_FIND(&http_nonces, &tmp, link, http_nonce_cmp); if (n) {