fix buffer overrun in "file:" driver