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

Commit 1f71e77f authored by Kenny Root's avatar Kenny Root Committed by Android (Google) Code Review
Browse files

Merge "Range check in MediaScanner::processDirectory"

parents e307dd2d eb03f13f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ status_t MediaScanner::processDirectory(

    int pathRemaining = PATH_MAX - pathLength;
    strcpy(pathBuffer, path);
    if (pathBuffer[pathLength - 1] != '/') {
    if (pathLength > 0 && pathBuffer[pathLength - 1]) {
        pathBuffer[pathLength] = '/';
        pathBuffer[pathLength + 1] = 0;
        --pathRemaining;