Skip to content
Permalink
Browse files

eas_mdls: fix OOB read.

Bug: 34031018
AOSP-Change-Id: I8d373c905f64286b23ec819bdbee51368b12e85a

CVE-2017-0541

Change-Id: Ifb1825e25751e98b7f1d5355c5d3d0699ec08be7
(cherry picked from commit 56d1532)
(cherry picked from commit f7b1abeb6bfd9eb404be641ea347cf2b1198140e)
  • Loading branch information...
Wei Jia authored and andi34 committed Feb 7, 2017
1 parent ba00921 commit 5e0e9db314c615f1fea90a76c432e9ead0813d14
Showing with 6 additions and 1 deletion.
  1. +6 −1 arm-wt-22k/lib_src/eas_mdls.c
@@ -114,6 +114,8 @@
/* this define allows us to use the sndlib.h structures as RW memory */
#define SCNST

#include "log/log.h"

#include "eas_data.h"
#include "eas_host.h"
#include "eas_mdls.h"
@@ -2086,8 +2088,11 @@ static EAS_RESULT PushcdlStack (EAS_U32 *pStack, EAS_INT *pStackPtr, EAS_U32 val
{

/* stack overflow, return an error */
if (*pStackPtr >= CDL_STACK_SIZE)
if (*pStackPtr >= (CDL_STACK_SIZE - 1)) {
ALOGE("b/34031018, stackPtr(%d)", *pStackPtr);
android_errorWriteLog(0x534e4554, "34031018");
return EAS_ERROR_FILE_FORMAT;
}

/* push the value onto the stack */
*pStackPtr = *pStackPtr + 1;

0 comments on commit 5e0e9db

Please sign in to comment.
You can’t perform that action at this time.