Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 597794

Summary: fileno (NULL) segfaults instead of return -1 and set errno to EBADF
Product: Red Hat Enterprise Linux 6 Reporter: Jan F. Chadima <jchadima>
Component: glibcAssignee: Andreas Schwab <schwab>
Status: CLOSED NOTABUG QA Contact: qe-baseos-tools
Severity: high Docs Contact:
Priority: low    
Version: 6.0CC: fweimer, jakub, schwab
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 597793 Environment:
Last Closed: 2010-05-31 08:32:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 597793    
Bug Blocks:    

Description Jan F. Chadima 2010-05-30 14:36:27 UTC
+++ This bug was initially created as a clone of Bug #597793 +++

Description of problem:
the function fileno crash the program, if called with NULL parameter
according to the documentation it should return -1 and set errno

Version-Release number of selected component (if applicable):
glibc-2.12.90-1.i686

How reproducible:
alvays

Steps to Reproduce:
compille and run:
#include <stdio.h>

int
main()
{
printf ("%d\n", fileno (NULL));
}
  
Actual results:
SIGSEGV

Expected results:
-1

Comment 2 Andreas Schwab 2010-05-31 08:32:38 UTC
NULL is not a pointer to a stream.