There has been a longstanding bug, where ubbthreads.inc.php ( lock_and_write function ) could write out a blank file for config.inc.php, as well as other files being 'edited'.
I mentioned this about 2 to 3 yrs ago and even posted a fix for it.
It never got implemented.
It has been implemented in the upcoming 7.6, however