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

Commit 16335690 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "[BugFix][HWASAN] stack-buffer-overflow"

parents 116c3655 086293c5
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -263,8 +263,12 @@ void android_os_Process_setProcessGroup(JNIEnv* env, jobject clazz, int pid, jin
        sprintf(proc_path, "/proc/%d/cmdline", pid);
        sprintf(proc_path, "/proc/%d/cmdline", pid);
        fd = open(proc_path, O_RDONLY | O_CLOEXEC);
        fd = open(proc_path, O_RDONLY | O_CLOEXEC);
        if (fd >= 0) {
        if (fd >= 0) {
            int rc = read(fd, cmdline, sizeof(cmdline)-1);
            ssize_t rc = read(fd, cmdline, sizeof(cmdline) - 1);
            if (rc < 0) {
                ALOGE("read /proc/%d/cmdline (%s)", pid, strerror(errno));
            } else {
                cmdline[rc] = 0;
                cmdline[rc] = 0;
            }
            close(fd);
            close(fd);
        }
        }