Only removing the it++ does in fact work. Thanks! I haven't followed the code around enough to know exactly what's going on yet, and STL didn't exist the last time I worked in C++ so I'm still trying to get up to speed with both the code and STL semantics.
There's another buglet in GetBaseFile that causes segfaults if you upload a directory with a trailing "/". I've only just glanced at it but it looks like when it parses a path/filename with the trailing "/" it returns a pointer to beyond the end of the path string?