diff options
author | 2024-12-18 13:31:44 -0800 | |
---|---|---|
committer | 2024-12-18 13:31:44 -0800 | |
commit | b2361af7335ebc09e3dc18e160f3fc16881848bc (patch) | |
tree | 248f10cdb8e3b7ac352d32506bfbf7db185ede9a | |
parent | 673f3aa7a9a8c33cf79952604f5df77fb759099f (diff) | |
parent | 0d8e27302bc8204bfa982874197aa1838cad4648 (diff) |
Merge "libinput: avoid null segmentation fault" into main
-rw-r--r-- | libs/input/KeyCharacterMap.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/input/KeyCharacterMap.cpp b/libs/input/KeyCharacterMap.cpp index 90d29dd190..d2c49b113d 100644 --- a/libs/input/KeyCharacterMap.cpp +++ b/libs/input/KeyCharacterMap.cpp @@ -615,7 +615,7 @@ std::unique_ptr<KeyCharacterMap> KeyCharacterMap::readFromParcel(Parcel* parcel) ALOGE("%s: Null parcel", __func__); return nullptr; } - std::string loadFileName = parcel->readCString(); + std::string loadFileName = parcel->readString8().c_str(); std::unique_ptr<KeyCharacterMap> map = std::make_unique<KeyCharacterMap>(KeyCharacterMap(loadFileName)); map->mType = static_cast<KeyCharacterMap::KeyboardType>(parcel->readInt32()); @@ -704,7 +704,7 @@ void KeyCharacterMap::writeToParcel(Parcel* parcel) const { ALOGE("%s: Null parcel", __func__); return; } - parcel->writeCString(mLoadFileName.c_str()); + parcel->writeString8(String8(mLoadFileName.c_str())); parcel->writeInt32(static_cast<int32_t>(mType)); parcel->writeBool(mLayoutOverlayApplied); |