Handle unusual results from find_tempdir.
PATCH 1/1 Handle unusual results from find_tempdir.
An alternative: make find_tempdir set tempdir to default_tempdir upon malloc failure.
* arch/um/os-Linux/mem.c (make_tempfile): Handle NULL tempdir. Don't let a long tempdir (e.g., via TMPDIR) provoke heap corruption.
Signed-off-by Jim Meyering <[email protected]>
--- arch/um/os-Linux/mem.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
arch/um/os-Linux/mem.c +3 -0
@@ -176,6 +176,9 @@ int __init make_tempfile(const char *template, char **out_tempname,return -1 ;find_tempdir (); +if (tempdir ==NULL ||strlen (tempdir) >=MAXPATHLEN ) +return -1 ; +if (template[0 ] !='/' )strcpy (tempname, tempdir);else
--
1.5.4.19.gd3dfd
Quoted 5 lines · Jim Meyering
An alternative: make
find_tempdirset tempdir todefault_tempdirupon malloc failure.*
arch/um/os-Linux/mem.c(make_tempfile): Handle NULL tempdir. Don't let a long tempdir (e.g., via TMPDIR) provoke heap corruption.
This wasn't meant for the linux-ext4 list, was it? I think maybe you typo'ed the mailing list this patch was supposed to be sent to?
Regards,
- Ted