lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <87ir138j9s.fsf@rho.meyering.net>
Date:	Tue, 05 Feb 2008 17:23:11 +0100
From:	Jim Meyering <jim@...ering.net>
To:	Jeff Dike <jdike@...toit.com>, linux-kernel@...r.kernel.org
Subject: [PATCH] uml: Handle failed malloc.


* arch/um/os-Linux/mem.c (make_tempfile): Don't deref NULL upon failed malloc.

Signed-off-by: Jim Meyering <meyering@...hat.com>
---
diff --git a/arch/um/os-Linux/mem.c b/arch/um/os-Linux/mem.c
index 436f8d2..e114d09 100644
--- a/arch/um/os-Linux/mem.c
+++ b/arch/um/os-Linux/mem.c
@@ -172,6 +172,8 @@ int __init make_tempfile(const char *template, char **out_tempname,

 	which_tmpdir();
 	tempname = malloc(MAXPATHLEN);
+	if (tempname == NULL)
+	  return -1;

 	find_tempdir();
 	if (template[0] != '/')
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ