This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 95b8699  Fix out of bounds access error in ats_base64_decode (#7490)
95b8699 is described below

commit 95b86998e37c57fb493a6d792d638e0368d7d80c
Author: Masakazu Kitajo <[email protected]>
AuthorDate: Thu Feb 11 03:45:45 2021 +0900

    Fix out of bounds access error in ats_base64_decode (#7490)
---
 src/tscore/ink_base64.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tscore/ink_base64.cc b/src/tscore/ink_base64.cc
index 22cb11f..a1da352 100644
--- a/src/tscore/ink_base64.cc
+++ b/src/tscore/ink_base64.cc
@@ -136,7 +136,7 @@ ats_base64_decode(const char *inBuffer, size_t 
inBufferSize, unsigned char *outB
 
   // Ignore any trailing ='s or other undecodable characters.
   // TODO: Perhaps that ought to be an error instead?
-  while (printableToSixBit[static_cast<uint8_t>(inBuffer[inBytes])] <= 
MAX_PRINT_VAL) {
+  while (inBytes < inBufferSize && 
printableToSixBit[static_cast<uint8_t>(inBuffer[inBytes])] <= MAX_PRINT_VAL) {
     ++inBytes;
   }
 

Reply via email to