Bug 10441 - Backtraces code example lacks error checking
Summary: Backtraces code example lacks error checking
Status: NEW
Alias: None
Product: glibc
Classification: Unclassified
Component: manual (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Roland McGrath
Depends on:
Reported: 2009-07-24 13:39 UTC by Christian Convey (work)
Modified: 2014-07-01 07:34 UTC (History)
1 user (show)

See Also:
Last reconfirmed:
fweimer: security-


Note You need to log in before you can comment on or make changes to this bug.
Description Christian Convey (work) 2009-07-24 13:39:36 UTC
On this page:  
there's a code example near the bottom of the page.

That code makes use of the return value from "backtrace_symbols", without 
first checking if the returned pointer is NULL.

You might argue that this code is just to get the general idea across, and is 
rightfully devoid of error checking.  That's obviously an editorial decision.  
What I can say is that, perhaps like many other people, I followed that 
example's structure without giving it much more thought, and in doing so 
unwittingly introducing a bug into my application.  So for that reason you 
might want to add error handling to the example code.