From 0c629a3857c31bee6fa39ba7a9a8cbcabeb383fd Mon Sep 17 00:00:00 2001 From: Gaurav Batra Date: Fri, 31 Oct 2014 16:13:38 -0700 Subject: camera: fix vendortags section malloc failure size_t type variables should be initialized properly especially on 64-bit archs if they are type casted to shorter datatypes for some operation and then later used in entirety. The results may be unpredictable since the most significant bytes may contain garbage. Bug 18222311 Change-Id: Iced82e964cf8c98f6856d257fc1534a5237a9064 --- camera/VendorTagDescriptor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'camera') diff --git a/camera/VendorTagDescriptor.cpp b/camera/VendorTagDescriptor.cpp index 0dda6b6..dce313a 100644 --- a/camera/VendorTagDescriptor.cpp +++ b/camera/VendorTagDescriptor.cpp @@ -206,7 +206,7 @@ status_t VendorTagDescriptor::createFromParcel(const Parcel* parcel, return res; } - size_t sectionCount; + size_t sectionCount = 0; if (tagCount > 0) { if ((res = parcel->readInt32(reinterpret_cast(§ionCount))) != OK) { ALOGE("%s: could not read section count for.", __FUNCTION__); -- cgit v1.1