Bugzilla – Bug 57
Unchecked malloc in tracejob in log_path()
Last modified: 2010-05-03 19:21:48 MDT
You need to log in before you can comment on or make changes to this bug.
Created an attachment (id=31) [details] Patch to check and report malloc failure in log_path in tracejob At line 831 of log_path() in branches/2.4-fixes/src/tools/tracejob.c there is a malloc() which is not checked for success leading to a potential crash when it is used in a strcpy() immediately afterwards. filenames[filecount] = malloc(strlen(buf)); strcpy(filenames[filecount],buf); I've attached a patch to perror() a message to the user and then return(-1) which is handled by the caller. This bug is also present in 2.3-fixes and trunk.
This bug is also on the 3.0-alpha branch
patch has been checked into the 2.3, 2.4, trunk and 3.0-alpha branches.
Thanks Al. Just for future reference I'm now at the University of Melbourne, not VPAC. :-)