VSIFileFromMemBuffer does not call NormalizePath before adding to oFileList
|Reported by:||des4maisons||Owned by:||warmerdam|
In port/cpl_vsi_mem.cpp, in VSIFileFromMemBuffer() line 736, NormalizePath is not called on the input filename before adding it to oFileList. This means that if a path comes in with a '\', it gets added to FileList map as is. However, the Open call at the end of the function normalizes the filename before checking to see if it's in oFileList, so it doesn't find the file. Therefore this always fails:
FILE* fp = VSIFileFromMemBuffer("/vsimem\hello", my_ptr, 100, FALSE); ASSERT(fp);
A fix would be to call NormalizePath on the filename given to VSIFileFromMemBuffer before using it.