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

Commit ddb1b744 authored by Doug Zongker's avatar Doug Zongker Committed by Android Git Automerger
Browse files

am c4804e9b: am d4592694: am 3ca99f6c: Merge "fix vulnerability in bspatch"

* commit 'c4804e9b':
  fix vulnerability in bspatch
parents eed64836 c4804e9b
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -205,6 +205,11 @@ int ApplyBSDiffPatchMem(const unsigned char* old_data, ssize_t old_size,
        ctrl[1] = offtin(buf+8);
        ctrl[2] = offtin(buf+16);

        if (ctrl[0] < 0 || ctrl[1] < 0) {
            printf("corrupt patch (negative byte counts)\n");
            return 1;
        }

        // Sanity check
        if (newpos + ctrl[0] > *new_size) {
            printf("corrupt patch (new file overrun)\n");