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

Commit 0cb1794c authored by Sergio Giro's avatar Sergio Giro Committed by android-build-merger
Browse files

Add bound checks to utf16_to_utf8 am: 0c9742db am: c0a1a318

am: d8d966fe

Change-Id: If941a1348dc4c2533faa89b2bb90783fb77a853e
parents 21539313 d8d966fe
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -237,7 +237,8 @@ void unmarshallAudioAttributes(const Parcel& parcel, audio_attributes_t *attribu
            // copying array size -1, array for tags was calloc'd, no need to NULL-terminate it
            size_t tagSize = realTagSize > AUDIO_ATTRIBUTES_TAGS_MAX_SIZE - 1 ?
                    AUDIO_ATTRIBUTES_TAGS_MAX_SIZE - 1 : realTagSize;
            utf16_to_utf8(tags.string(), tagSize, attributes->tags);
            utf16_to_utf8(tags.string(), tagSize, attributes->tags,
                    sizeof(attributes->tags) / sizeof(attributes->tags[0]));
        }
    } else {
        ALOGE("unmarshallAudioAttributes() received unflattened tags, ignoring tag values");