mirror of
https://git.743378673.xyz/MeloNX/MeloNX.git
synced 2025-07-30 18:07:11 +02:00
hle: Improve safety (#2778)
* timezone: Make timezone implementation safe * hle: Do not use TrimEnd to parse ASCII strings This adds an util that handle reading an ASCII string in a safe way. Previously it was possible to read malformed data that could cause various undefined behaviours in multiple services. * hid: Remove an useless unsafe modifier on keyboard update * Address gdkchan's comment * Address gdkchan's comment
This commit is contained in:
parent
8dc729db0a
commit
6653a14859
9 changed files with 141 additions and 172 deletions
|
@ -125,7 +125,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
|
|||
|
||||
(ulong bufferPosition, ulong bufferSize) = context.Request.GetBufferType0x21();
|
||||
|
||||
string locationName = Encoding.ASCII.GetString(context.RequestData.ReadBytes(0x24)).TrimEnd('\0');
|
||||
string locationName = StringUtils.ReadInlinedAsciiString(context.RequestData, 0x24);
|
||||
|
||||
ResultCode result;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue