Commit 22caa0417db3b1d3dfafc9b7c0bf31baf8d667e7

Authored by Jim Meyering
Committed by Linus Torvalds
1 parent cd6fda3608

lib/inflate.c: handle failed malloc()

lib/inflate.c (inflate_dynamic): Don't deref NULL upon failed malloc.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 3 additions and 0 deletions Side-by-side Diff

... ... @@ -811,6 +811,9 @@
811 811 ll = malloc(sizeof(*ll) * (286+30)); /* literal/length and distance code lengths */
812 812 #endif
813 813  
  814 + if (ll == NULL)
  815 + return 1;
  816 +
814 817 /* make local bit buffer */
815 818 b = bb;
816 819 k = bk;