diff options
author | Jeremy Compostella <jeremy.compostella@intel.com> | 2015-07-29 17:17:03 +0200 |
---|---|---|
committer | Gaelle Nassiet <gaellex.nassiet@intel.com> | 2015-08-05 10:15:32 +0200 |
commit | 1b7d9b736888096db9907031c5c9307cf4989a51 (patch) | |
tree | b84700d595d01a7936aed8b98354ee6b7a0232e0 /recovery.cpp | |
parent | Merge "recovery: Allow "Mount /system" for system_root_image." (diff) | |
download | android_bootable_recovery-1b7d9b736888096db9907031c5c9307cf4989a51.tar android_bootable_recovery-1b7d9b736888096db9907031c5c9307cf4989a51.tar.gz android_bootable_recovery-1b7d9b736888096db9907031c5c9307cf4989a51.tar.bz2 android_bootable_recovery-1b7d9b736888096db9907031c5c9307cf4989a51.tar.lz android_bootable_recovery-1b7d9b736888096db9907031c5c9307cf4989a51.tar.xz android_bootable_recovery-1b7d9b736888096db9907031c5c9307cf4989a51.tar.zst android_bootable_recovery-1b7d9b736888096db9907031c5c9307cf4989a51.zip |
Diffstat (limited to '')
-rw-r--r-- | recovery.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/recovery.cpp b/recovery.cpp index 8123903ae..d90e10a8b 100644 --- a/recovery.cpp +++ b/recovery.cpp @@ -1036,11 +1036,15 @@ main(int argc, char **argv) { if (strncmp(update_package, "CACHE:", 6) == 0) { int len = strlen(update_package) + 10; char* modified_path = (char*)malloc(len); - strlcpy(modified_path, "/cache/", len); - strlcat(modified_path, update_package+6, len); - printf("(replacing path \"%s\" with \"%s\")\n", - update_package, modified_path); - update_package = modified_path; + if (modified_path) { + strlcpy(modified_path, "/cache/", len); + strlcat(modified_path, update_package+6, len); + printf("(replacing path \"%s\" with \"%s\")\n", + update_package, modified_path); + update_package = modified_path; + } + else + printf("modified_path allocation failed\n"); } } printf("\n"); |