Fixes Treble marshaling of strings embedded in structures from Java

Bug: 35038064
Test: hidl_test_java
Change-Id: Ibfdeae06fdf3982d226a7fa87d4c23feeb8e766e
This commit is contained in:
Andreas Huber
2017-02-06 11:49:26 -08:00
parent ff1d8da55e
commit 7e60311162

View File

@@ -382,7 +382,7 @@ static void JHwBlob_native_putString(
s = nullptr;
hidl_string tmp;
tmp.setToExternal(static_cast<const char *>(subBlob->data()), size);
tmp.setToExternal(static_cast<const char *>(subBlob->data()), size - 1);
sp<JHwBlob> blob = JHwBlob::GetNativeContext(env, thiz);
blob->write(offset, &tmp, sizeof(tmp));