commit | 61c3f904794b23ca656e1f78f9d031592b6750f7 | [log] [tgz] |
---|---|---|
author | Linux Build Service Account <lnxbuild@quicinc.com> | Tue Jul 18 06:47:59 2017 -0700 |
committer | Gerrit - the friendly Code Review server <code-review@localhost> | Tue Jul 18 06:47:59 2017 -0700 |
tree | 3356da7a5210755761b341b2683be50c8996bf0d | |
parent | 0949008136dc244566662e109d6db362113674f7 [diff] | |
parent | 167995ff501efd7b06b88d8f7347f11467ab9b6a [diff] |
Merge "aboot : mdtp: Fixed heap overflow issue"
diff --git a/platform/msm_shared/flash-ubi.c b/platform/msm_shared/flash-ubi.c index ca46876..e0836c6 100644 --- a/platform/msm_shared/flash-ubi.c +++ b/platform/msm_shared/flash-ubi.c
@@ -855,6 +855,12 @@ /* Total size of valid data in peb */ peb_valid_sz = num_pages * page_size; + if (size < UBI_MAGIC_SIZE) + { + dprintf(CRITICAL, "flash_ubi_img: invalid size provided.\n"); + return -1; + } + /* * Check for oob access if any in img_peb. */