potential bufferoverflow throught large windir avoided