IAudioPolicyService: Add attribute tags sanitization
When audio_attributes_t was read from the binder parcel,
the string tags field was copied without checking that
it contained a '\0'.
This could lead to read past the end when tags were used.
This patch always adds a '\0' at the end of the buffer when
Test: manual playback/record
Test: send binder payload without \0 in tags attribute, check that only
AUDIO_ATTRIBUTES_TAGS_MAX_SIZE - 1 char are printed.
Signed-off-by: Kevin Rocard <firstname.lastname@example.org>
(cherry picked from commit 39fdbd097a147b5c719dac9ad2759e6c44eb3a4e)
2 files changed