Check the length returned from GetModuleFileName() to make sure something was returned and it's in range. Something like:

```
	DWORD dwFLen = GetModuleFileName(module, executablePath, MAX_PATH);
	if (dwFLen == 0)
		return AtlHresultFromLastError();
	else if (dwFLen == MAX_PATH)
		return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
```