From aab6d0d0814cdcfcc0f4e8fd8a731334d62fbabd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20Halld=C3=A9n?= Date: Wed, 12 Oct 2022 07:34:22 +0200 Subject: [PATCH] Check return value from FileRead (#663) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Max Halldén --- Facepunch.Steamworks/SteamRemoteStorage.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Facepunch.Steamworks/SteamRemoteStorage.cs b/Facepunch.Steamworks/SteamRemoteStorage.cs index 03cadb5..5755d71 100644 --- a/Facepunch.Steamworks/SteamRemoteStorage.cs +++ b/Facepunch.Steamworks/SteamRemoteStorage.cs @@ -48,6 +48,10 @@ namespace Steamworks fixed ( byte* ptr = buffer ) { var readsize = Internal.FileRead( filename, (IntPtr)ptr, size ); + if ( readsize != size ) + { + return null; + } return buffer; } }