mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-26 01:04:17 +00:00
storage: Don't allow "." and ".." paths, enforce '/' dir separators.
Also clarify what characters are valid for Storage paths in the category docs. Fixes #11079. Fixes #11370. Fixes #11369.
This commit is contained in:
@@ -222,6 +222,22 @@
|
||||
* playing on another PC (and vice versa) with the save data fully
|
||||
* synchronized across all devices, allowing for a seamless experience without
|
||||
* having to do full restarts of the program.
|
||||
*
|
||||
* ## Notes on valid paths
|
||||
*
|
||||
* All paths in the Storage API use Unix-style path separators ('/'). Using a
|
||||
* different path separator will not work, even if the underlying platform
|
||||
* would otherwise accept it. This is to keep code using the Storage API
|
||||
* portable between platforms and Storage implementations and simplify app
|
||||
* code.
|
||||
*
|
||||
* Paths with relative directories ("." and "..") are forbidden by the Storage
|
||||
* API.
|
||||
*
|
||||
* All valid UTF-8 strings (discounting the NULL terminator character and the
|
||||
* '/' path separator) are usable for filenames, however, an underlying
|
||||
* Storage implementation may not support particularly strange sequences and
|
||||
* refuse to create files with those names, etc.
|
||||
*/
|
||||
|
||||
#ifndef SDL_storage_h_
|
||||
|
||||
Reference in New Issue
Block a user