From: Amos Jeffries Date: Thu, 8 Jan 2015 23:00:40 +0000 (-0800) Subject: cachemgr.cgi: exit on base64 decode failures X-Git-Tag: merge-candidate-3-v1~363 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ccd727e094fd723d6fceca2bd91ab16627064bcc;p=thirdparty%2Fsquid.git cachemgr.cgi: exit on base64 decode failures Detected by Coverity Scan. Issue 1261431 --- diff --git a/tools/cachemgr.cc b/tools/cachemgr.cc index 8d55d6d0fe..fbbd433bfa 100644 --- a/tools/cachemgr.cc +++ b/tools/cachemgr.cc @@ -1104,8 +1104,8 @@ decode_pub_auth(cachemgr_request * req) buf = (char*)xmalloc(decodedLen); struct base64_decode_ctx ctx; base64_decode_init(&ctx); - base64_decode_update(&ctx, &decodedLen, reinterpret_cast(buf), strlen(req->pub_auth), reinterpret_cast(req->pub_auth)); - if (!base64_decode_final(&ctx)) { + if (!base64_decode_update(&ctx, &decodedLen, reinterpret_cast(buf), strlen(req->pub_auth), reinterpret_cast(req->pub_auth)) || + !base64_decode_final(&ctx)) { debug("cmgr: base64 decode failure. Incomplete auth token string.\n"); xfree(buf); return;