summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2018-10-05 13:42:53 -0700
committerSteven Moreland <smoreland@google.com>2018-10-05 13:43:11 -0700
commit164636ceefee811cde73857038dfe8c4b85c6fed (patch)
tree8b9ce6430087c978bc6f4aae7641164c222c4b4d
parentcd1ce760e8109eb91ce9d3e91fdaabb866262045 (diff)
downloadnative-164636ceefee811cde73857038dfe8c4b85c6fed.tar.gz
libbinder_ndk: prune errors on AStatus create
Otherwise, they could escape into another process. Bug: 111445392 Test: atest android.binder.cts Change-Id: Id7bfb63c20fb8ec4f0ca9ce51abb530a961e8dfe
-rw-r--r--libs/binder/ndk/status.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/libs/binder/ndk/status.cpp b/libs/binder/ndk/status.cpp
index e0ae469c3a..1f75b0b05d 100644
--- a/libs/binder/ndk/status.cpp
+++ b/libs/binder/ndk/status.cpp
@@ -27,11 +27,11 @@ AStatus* AStatus_newOk() {
}
AStatus* AStatus_fromExceptionCode(binder_exception_t exception) {
- return new AStatus(Status::fromExceptionCode(exception));
+ return new AStatus(Status::fromExceptionCode(PruneException(exception)));
}
AStatus* AStatus_fromExceptionCodeWithMessage(binder_exception_t exception, const char* message) {
- return new AStatus(Status::fromExceptionCode(exception, message));
+ return new AStatus(Status::fromExceptionCode(PruneException(exception), message));
}
AStatus* AStatus_fromServiceSpecificError(int32_t serviceSpecific) {
@@ -43,7 +43,7 @@ AStatus* AStatus_fromServiceSpecificErrorWithMessage(int32_t serviceSpecific, co
}
AStatus* AStatus_fromStatus(binder_status_t status) {
- return new AStatus(Status::fromStatusT(status));
+ return new AStatus(Status::fromStatusT(PruneStatusT(status)));
}
bool AStatus_isOk(const AStatus* status) {