On this page: http://www.gnu.org/software/libc/manual/html_node/Backtraces.html 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.
Hi I see this is 10 years and not updated... Can put a bug bounty of $30 on this for a fix. BTW, also the size_t size; is not correct, it returns int. and the printf then needs update to %d
Fixed on 2.32 (5d5b3bd94ceebe13d54a6e0cc9e2a899adbbc56f).