Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
http: handle negative value from base64_decode (coverity)
  • Loading branch information
perexg committed Oct 3, 2014
1 parent 1589bd8 commit 7fc28ac
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/http.c
Expand Up @@ -638,6 +638,8 @@ process_request(http_connection_t *hc, htsbuf_queue_t *spill)
if((v = http_arg_get(&hc->hc_args, "Authorization")) != NULL) {
if((n = http_tokenize(v, argv, 2, -1)) == 2) {
n = base64_decode(authbuf, argv[1], sizeof(authbuf) - 1);
if (n < 0)
n = 0;
authbuf[n] = 0;
if((n = http_tokenize((char *)authbuf, argv, 2, ':')) == 2) {
hc->hc_username = strdup(argv[0]);
Expand Down

0 comments on commit 7fc28ac

Please sign in to comment.