]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
http: handle negative value from base64_decode (coverity)
authorJaroslav Kysela <perex@perex.cz>
Fri, 3 Oct 2014 12:47:23 +0000 (14:47 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 3 Oct 2014 12:47:23 +0000 (14:47 +0200)
src/http.c

index f591317465e79b4175308a8568bd594d4f34ee08..dc9e741d1dc466c31bf6c0eaf2f85540a6fb02f9 100644 (file)
@@ -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]);