nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] segmentation fault when trying to browse to an inaccess


From: Benno Schulenberg
Subject: Re: [Nano-devel] segmentation fault when trying to browse to an inaccessible directory
Date: Wed, 08 Jun 2016 20:57:34 +0200

On Wed, Jun 8, 2016, at 19:12, Rishabh Dave wrote:
> > Would it be possible for path or dir to be NULL while filelist is
> > still NULL, so that
> >   present_name = mallocstrcpy(present_name, filelist[selected]);
> > would crash?
> >
> It would be case where nano loses permission for the directory where
> nano was invoked; this must happen after invoking nano but before
> invoking browser.

It would be nice if you had given a reproduction recipe -- the exact
sequence of keys to hit and commands to give in different terminals.
But okay, it wasn't that hard:

mkdir nox && cd nox && chmod a-x ../nox && ~/repopath/src/nano

The startup message is puzzling:

  Path '.': Permission denied

Then type ^R ^T

Segmentation fault.


> Patch is attached.

Hm.  I don't like the solution.  I would, after printing the error message,
check if filelist is null, and if so, pause shortly (like for the message
when the working directory has disappeared) and then return from do_browser(),
because nothing can be done anyway.

> Thanks for the opportunity and the hint!  :)

:)

Benno

-- 
http://www.fastmail.com - Choose from over 50 domains or use your own




reply via email to

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