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

Commit d63310e7 authored by Greg Kaiser's avatar Greg Kaiser Committed by android-build-merger
Browse files

Merge "installd: Avoid potential use of null \'src\'." into nyc-dev am: d44b290d

am: 63cf7854

* commit '63cf7854':
  installd: Avoid potential use of null 'src'.
parents e6988b3d 63cf7854
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -128,13 +128,13 @@ bool calculate_odex_file_path(char path[PKG_PATH_MAX],
bool create_cache_path(char path[PKG_PATH_MAX],
bool create_cache_path(char path[PKG_PATH_MAX],
                       const char *src,
                       const char *src,
                       const char *instruction_set) {
                       const char *instruction_set) {
    size_t srclen = strlen(src);

    /* demand that we are an absolute path */
    /* demand that we are an absolute path */
    if ((src == 0) || (src[0] != '/') || strstr(src,"..")) {
    if ((src == nullptr) || (src[0] != '/') || strstr(src,"..")) {
        return false;
        return false;
    }
    }


    size_t srclen = strlen(src);

    if (srclen > PKG_PATH_MAX) {        // XXX: PKG_NAME_MAX?
    if (srclen > PKG_PATH_MAX) {        // XXX: PKG_NAME_MAX?
        return false;
        return false;
    }
    }