Merge "sdcard: mute false compiler alarm" am: cb4e164562 am: 124294a348

am: e657bf552c

Change-Id: I1e75decd46537a7697840908146981a4650ca417
This commit is contained in:
Ting-Yuan Huang 2017-08-30 02:53:36 +00:00 committed by android-build-merger
commit 9cd73e43ed
1 changed files with 3 additions and 1 deletions

View File

@ -249,7 +249,9 @@ static void run(const char* source_path, const char* label, uid_t uid,
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;