Merge "sdcard: mute false compiler alarm" am: cb4e164562 am: 124294a348 am: e657bf552c
am: 9cd73e43ed
Change-Id: Ic80193f847e4b8c8700f27b251dbf8cd5cb9d316
diff --git a/sdcard/sdcard.cpp b/sdcard/sdcard.cpp
index c342cf8..343a903 100644
--- a/sdcard/sdcard.cpp
+++ b/sdcard/sdcard.cpp
@@ -249,7 +249,9 @@
global.root.uid = AID_ROOT;
global.root.under_android = false;
- strcpy(global.source_path, source_path);
+ // Clang static analyzer think strcpy potentially overwrites other fields
+ // in global. Use snprintf() to mute the false warning.
+ snprintf(global.source_path, sizeof(global.source_path), "%s", source_path);
if (multi_user) {
global.root.perm = PERM_PRE_ROOT;