Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
http: http_nonce_exists - fix possible string overflow - coverity
  • Loading branch information
perexg committed May 23, 2016
1 parent ce8d357 commit 86e1f02
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/http.c
Expand Up @@ -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) {
Expand Down

0 comments on commit 86e1f02

Please sign in to comment.