bugGNU nano - Bugs: bug #30671, [BUG] nano segfaults when...

 
 
Show feedback again

bug #30671: [BUG] nano segfaults when interactively providing filenames

Submitted by:  None
Submitted on:  Fri 06 Aug 2010 03:44:11 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: OpenRelease: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 06 Aug 2010 03:44:11 PM UTC, original submission:

I'm crosscompiling nano to run on a Fritz!Box.

Compiling without --enable-tiny results in a segfault when trying to save a file by overwriting (file to overwrite is prompted). The binary compiled with option --enable-tiny works great (at least in that matter).

I found a bug in file files.c on line 1508:
<code>
if (openfile->current_stat == NULL && !tmp && realexists)
stat(realname, openfile->current_stat);
</code>

On my Ubuntu this is not a problem, probably due to the implementation of stat, but on my Fritz!Box it fails. That is obviously because openfile->current_stat is NULL (just checked above). So a malloc should be called here:
<code>
if (openfile->current_stat == NULL && !tmp && realexists) {
openfile->current_stat = (struct stat *)nmalloc(sizeof(struct stat));
stat(realname, openfile->current_stat);
}
</code>
just like on lines 153 and 1874.

A patch is attached to this report, hope you find it useful.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #21160:  files.c.patch added by None (757B - text/x-patch - patch should fix the bug)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follows 1 latest change.

Date Changed By Updated Field Previous Value => Replaced By
Fri 06 Aug 2010 03:44:11 PM UTCNoneAttached File-=>Added files.c.patch, #21160
Show feedback again

Back to the top


Powered by Savane 3.1-cleanup