[BusyBox 0000600]: less segfaults if controlling terminal cannot be open

bugs at busybox.net bugs at busybox.net
Thu Dec 15 11:27:42 UTC 2005


The following issue has been SUBMITTED. 
====================================================================== 
http://busybox.net/bugs/view.php?id=600 
====================================================================== 
Reported By:                iggarpe
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   600
Category:                   Other
Reproducibility:            always
Severity:                   crash
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             12-15-2005 03:27 PST
Last Modified:              12-15-2005 03:27 PST
====================================================================== 
Summary:                    less segfaults if controlling terminal cannot be
open
Description: 
If the controlling terminal cannot be open, less segfaults. Not being able
to open the controlling terminal is certainly an error condition by
itself, but less should at least print an error message and exit
gracefully instead of segfaulting.

The cause is that there is no error check in the open(CURRENT_TTY) call,
which later leads to fileno(inp) segfault since inp == NULL.

Attached patch checks inp == NULL after the open call, prints an error,
and dies.
====================================================================== 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
12-15-05 03:27  iggarpe        New Issue                                    
12-15-05 03:27  iggarpe        Status                   new => assigned     
12-15-05 03:27  iggarpe        Assigned To               => BusyBox         
12-15-05 03:27  iggarpe        File Added: less.diff                        
======================================================================




More information about the busybox-cvs mailing list