From 63b0fede0f8140be8b4534a6d7d0ae06dfe4da23 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Thu, 17 Oct 2013 22:28:39 +0200 Subject: [PATCH] android: Fix crash in property_get stub If value was not found and default_value was not provided NULL pointer was passed as argument to strncpy resulting in crash. --- android/cutils/properties.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/cutils/properties.h b/android/cutils/properties.h index a9f7554af..44a712c30 100644 --- a/android/cutils/properties.h +++ b/android/cutils/properties.h @@ -43,7 +43,7 @@ static inline int property_get(const char *key, char *value, if (!env) env = default_value; - if (!value) + if (!value || !env) return 0; strncpy(value, env, PROPERTY_VALUE_MAX); -- 2.47.3