To my horror I find that many calls to malloc() in the source are unchecked for a null return. Example from libvlc.c:
Code: Select all
/*
* Initialize hotkey handling
*/
var_Create( p_vlc, "key-pressed", VLC_VAR_INTEGER );
p_vlc->p_hotkeys = malloc( sizeof(p_hotkeys) );
/* Do a copy (we don't need to modify the strings) */
memcpy( p_vlc->p_hotkeys, p_hotkeys, sizeof(p_hotkeys) );
Code: Select all
putenv( "MALLOC_CHECK_=2" );
This is a first scan through just a few modules, and those calls simply leapt out at me. I'm wondering if this code is bomb-proof, and what other goodies await me .
The primary reason I make this point is that the application is to run on stand-alone monitors at an airport - i.e. it's very public. The last thing I need is a bunch of crashed applications with dialog boxes sat on the screen.
Can anyone allay my fears?
Dave