Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit ef80764d authored by Marcus Oakland's avatar Marcus Oakland Committed by Ashok Bhat
Browse files

AArch64: AString::append for longs and pointers



The AString::append methods for long, unsigned long and void *
pointers were using char arrays of 16 elements, which were not long
enough for 64-bit longs and pointers in __LP64__ systems. This
resulted in "FORTIFY_SOURCE: vsprintf: prevented write past end of
buffer. Calling abort()." when the
android.media.cts.DecoderTest#testFlush CTS test was run.

The AString::append methods that were using sprintf have been modifed
to use snprintf instead, taking the sizeof the "s" array (which has
been made 32 char without conditional compilation for __LP64__ where
appropriate), and checking the return value to ensure that the string
has not been truncated.

After this change and changes to the types of OMX_U32 and OMX_S32 in the
frameworks/native/include/media/openmax/OMX_Types.h header file, the
android.media.cts.DecoderTest#testFlush CTS test passes.

Change-Id: I76d897373473c82f52986f43a15b050b844a370a
Signed-off-by: default avatarMarcus Oakland <marcus.oakland@arm.com>
parent 9829344d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment