http: handle negative value from base64_decode (coverity)
This commit is contained in:
parent
1589bd8326
commit
7fc28acf56
1 changed files with 2 additions and 0 deletions
|
@ -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]);
|
||||
|
|
Loading…
Add table
Reference in a new issue