DO NOT MERGE. Fix crash in vold
b/11239345
Change-Id: I46a8d6b38e3c093e20e1e5c4f01efc13d1960ad4
diff --git a/VolumeManager.cpp b/VolumeManager.cpp
index 1690a01..950138c 100644
--- a/VolumeManager.cpp
+++ b/VolumeManager.cpp
@@ -1584,7 +1584,7 @@
// Require that path lives under a volume we manage
const char* emulated_source = getenv("EMULATED_STORAGE_SOURCE");
const char* root = NULL;
- if (!strncmp(path, emulated_source, strlen(emulated_source))) {
+ if (emulated_source && !strncmp(path, emulated_source, strlen(emulated_source))) {
root = emulated_source;
} else {
Volume* vol = getVolumeForFile(path);