[PATCH 3/5] android: Fix crash in property_get stub

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Szymon Janc <szymon.janc@xxxxxxxxx>

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 a9f7554..44a712c 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);
-- 
1.8.4.rc3

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux