OSDN Git Service

Camera metadata: Check source metadata size
authorEmilian Peev <epeev@google.com>
Mon, 6 Nov 2017 10:41:19 +0000 (10:41 +0000)
committerEmilian Peev <epeev@google.com>
Mon, 6 Nov 2017 13:08:34 +0000 (13:08 +0000)
commit489bbd13bf0add8029444b9d9505b3d118776ea3
tree306194e5492694f27f0aa5d0917ebfeac2f3466b
parent960cba3e1b536563f110cc7094883c7c78b056ad
Camera metadata: Check source metadata size

Source size passed by client could be smaller than 'camera_metadata_t'.
In this case the cast in 'allocate_copy_camera_metadata_checked()' will
be incorrect and we will try to access invalid heap memory.

Bug: 67782345
Test: Camera CTS
Change-Id: I9582c704f414493978d09ffb603b5e8368cda5ce
camera/src/camera_metadata.c