Fix: Native crash when an empty attribute is written.
Bug: 10964805 Change-Id: Ia3cd891d20aee2226092f0f646d8f280901786fcmain
parent
3d92954120
commit
9cb1e78a44
|
@ -139,6 +139,9 @@ const char *const HeaderReadWriteUtils::REQUIRES_FRENCH_LIGATURE_PROCESSING_KEY
|
||||||
int *const writingPos) {
|
int *const writingPos) {
|
||||||
for (AttributeMap::const_iterator it = headerAttributes->begin();
|
for (AttributeMap::const_iterator it = headerAttributes->begin();
|
||||||
it != headerAttributes->end(); ++it) {
|
it != headerAttributes->end(); ++it) {
|
||||||
|
if (it->first.empty() || it->second.empty()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
// Write a key.
|
// Write a key.
|
||||||
if (!buffer->writeCodePointsAndAdvancePosition(&(it->first.at(0)), it->first.size(),
|
if (!buffer->writeCodePointsAndAdvancePosition(&(it->first.at(0)), it->first.size(),
|
||||||
true /* writesTerminator */, writingPos)) {
|
true /* writesTerminator */, writingPos)) {
|
||||||
|
|
Loading…
Reference in New Issue