Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad509fd4 authored by Tao Bao's avatar Tao Bao Committed by Gerrit Code Review
Browse files

Merge "Fix potential crash"

parents 0d46c7ab 1b7d9b73
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -1036,12 +1036,16 @@ main(int argc, char **argv) {
        if (strncmp(update_package, "CACHE:", 6) == 0) {
            int len = strlen(update_package) + 10;
            char* modified_path = (char*)malloc(len);
            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");