nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] unlink(NULL) can crash


From: David Benbennick
Subject: [Nano-devel] unlink(NULL) can crash
Date: Thu, 21 Oct 2004 21:02:07 -0400
User-agent: Mutt/1.4.1i

The man page for unlink() doesn't specify whether it accepts NULL.  If you 
try to write to an unwritable file, in files.c:write_file(), Nano calls
        unlink(tempname)
but tempname has been set only in prepend mode.

The glibc version of unlink() doesn't have any problem with NULL.  But 
when I tried to use a different library (libtrash), Nano crashed.  Here's 
a patch.

I bet there are other system calls that need to be protected in the same 
way.

Attachment: unlink.patch
Description: Text document

Attachment: pgpXPEOhmiKz9.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]