987d7dd886
ValidFileNameComponent() has been missing a NULL check for its argument. It's pretty obvious that NULL is not a valid file name component.