Validate parameters to SDL_ReadStorageFile() and SDL_WriteStorageFile()
This commit is contained in:
@@ -251,6 +251,9 @@ bool SDL_ReadStorageFile(SDL_Storage *storage, const char *path, void *destinati
|
|||||||
CHECK_PARAM(!ValidateStoragePath(path)) {
|
CHECK_PARAM(!ValidateStoragePath(path)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
CHECK_PARAM(length > 0 && !destination) {
|
||||||
|
return SDL_InvalidParamError("destination");
|
||||||
|
}
|
||||||
|
|
||||||
if (!storage->iface.read_file) {
|
if (!storage->iface.read_file) {
|
||||||
return SDL_Unsupported();
|
return SDL_Unsupported();
|
||||||
@@ -269,6 +272,9 @@ bool SDL_WriteStorageFile(SDL_Storage *storage, const char *path, const void *so
|
|||||||
CHECK_PARAM(!ValidateStoragePath(path)) {
|
CHECK_PARAM(!ValidateStoragePath(path)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
CHECK_PARAM(length > 0 && !source) {
|
||||||
|
return SDL_InvalidParamError("source");
|
||||||
|
}
|
||||||
|
|
||||||
if (!storage->iface.write_file) {
|
if (!storage->iface.write_file) {
|
||||||
return SDL_Unsupported();
|
return SDL_Unsupported();
|
||||||
|
|||||||
Reference in New Issue
Block a user