bugAVR C Runtime Library - Bugs: bug #6141, printf(), printf_P() dont check if...

 
 

bug #6141: printf(), printf_P() dont check if STDOUT == NULL

Submitted by:  Andreas Becker <andreas_becker>
Submitted on:  Fri 24 Oct 2003 10:52:45 AM UTC  
 
Category: LibrarySeverity: 2 - Minor
Priority: 5 - NormalItem Group: None
Status: InvalidPercent Complete: 0%
Assigned to: Joerg Wunsch <joerg_wunsch>Open/Closed: Closed
Release: NoneFixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Sun 19 Sep 2004 09:43:16 PM UTC, comment #2:

Andreas never responded to my earlier discussion.

I still think it's a pilot error, and penalizing users who
properly ensure they don't pass NULL isn't the right way to
go.

Joerg Wunsch <joerg_wunsch>
Project AdministratorIn charge of this item.
Fri 12 Mar 2004 09:44:25 PM UTC, comment #1:

I still think it's an operator fault rather than a bug.
After all, why penalize all users who do it right, by
introducing additional checks at each invocation? (The
check needs to be done in putc() in order to be useful,
which will imply a high cost.)

Joerg Wunsch <joerg_wunsch>
Project AdministratorIn charge of this item.
Fri 24 Oct 2003 10:52:45 AM UTC, original submission:

The Functions printf() and printf_P assume, that the caller allways did a fdevopen() before.
If not, they writing to the registers (printf_P, line 44)

My Solution looks like this:
insert the following code at printf.c:41 and printf_p.c:43.

if (stdout == NULL) {
return EOF;
}
The check in printf.c protects the called vfprintf function.

Andreas Becker <andreas_becker>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

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

 

 

Follow 4 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sun 19 Sep 2004 09:43:16 PM UTCjoerg_wunschStatusNone=>Invalid
  Open/ClosedOpen=>Closed
Fri 12 Mar 2004 09:44:25 PM UTCjoerg_wunschSeverity3 - Normal=>2 - Minor
Fri 12 Mar 2004 09:42:45 PM UTCjoerg_wunschAssigned toNone=>joerg_wunsch

Back to the top


Powered by Savane 3.1-cleanup1