summaryrefslogtreecommitdiffstats
path: root/lib/inflate.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2008-04-29 09:59:09 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 17:06:02 +0200
commit22caa0417db3b1d3dfafc9b7c0bf31baf8d667e7 (patch)
tree9d83fa00c532035b9f7c08f498973e5499483e6a /lib/inflate.c
parenthfsplus: handle match_strdup failure (diff)
downloadlinux-22caa0417db3b1d3dfafc9b7c0bf31baf8d667e7.tar.xz
linux-22caa0417db3b1d3dfafc9b7c0bf31baf8d667e7.zip
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>
Diffstat (limited to 'lib/inflate.c')
-rw-r--r--lib/inflate.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/inflate.c b/lib/inflate.c
index 845f91d3ac12..9762294be062 100644
--- a/lib/inflate.c
+++ b/lib/inflate.c
@@ -811,6 +811,9 @@ DEBG("<dyn");
ll = malloc(sizeof(*ll) * (286+30)); /* literal/length and distance code lengths */
#endif
+ if (ll == NULL)
+ return 1;
+
/* make local bit buffer */
b = bb;
k = bk;