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

Commit aa1e816f authored by Jesper Juhl's avatar Jesper Juhl Committed by Linus Torvalds
Browse files

[PATCH] Fix potential NULL pointer deref in gen_init_cpio



Fix potential NULL pointer deref in gen_init_cpio.c spotted by coverity
checker.  This fixes coverity bug #86

Without this patch we risk dereferencing a NULL `type' in the
"if ('\n' == *type) {" line.

Signed-off-by: default avatarJesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 9dfb563b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -471,6 +471,7 @@ int main (int argc, char *argv[])
				"ERROR: incorrect format, could not locate file type line %d: '%s'\n",
				line_nr, line);
			ec = -1;
			break;
		}

		if ('\n' == *type) {
@@ -506,6 +507,7 @@ int main (int argc, char *argv[])
				line_nr, line);
		}
	}
	if (ec == 0)
		cpio_trailer();

	exit(ec);