summaryrefslogtreecommitdiff
path: root/base/HidlSupport.cpp
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2017-02-17 14:10:17 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-02-17 14:10:17 +0000
commitb54e30bdf0979e26720099671bc61c5025375738 (patch)
treeb2b1b32e0f737a84f89342ced78d46c0c2b8d178 /base/HidlSupport.cpp
parentb2c5b69d1d12f0c1b7381ebaa6d57adea5ee8e12 (diff)
parent072984bb72b181c5bbfc57d776a4bd49abbe43b5 (diff)
downloadlibhidl-b54e30bdf0979e26720099671bc61c5025375738.tar.gz
hidl_string: allow null cstr am: a21d84f11f am: 55107b3754 am: f78b5afd0a
am: 072984bb72 Change-Id: I6fc221a0c03665370434caad683613a9223f8d6d
Diffstat (limited to 'base/HidlSupport.cpp')
-rw-r--r--base/HidlSupport.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/base/HidlSupport.cpp b/base/HidlSupport.cpp
index dd93534..b359f1d 100644
--- a/base/HidlSupport.cpp
+++ b/base/HidlSupport.cpp
@@ -196,6 +196,10 @@ hidl_string::~hidl_string() {
}
hidl_string::hidl_string(const char *s) : hidl_string() {
+ if (s == nullptr) {
+ return;
+ }
+
copyFrom(s, strlen(s));
}