diff options
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 68bff11ec..738db528d 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -332,7 +332,9 @@ static ResultCode UnmapMemory(Core::System& system, VAddr dst_addr, VAddr src_ad | |||
| 332 | /// Connect to an OS service given the port name, returns the handle to the port to out | 332 | /// Connect to an OS service given the port name, returns the handle to the port to out |
| 333 | static ResultCode ConnectToNamedPort(Core::System& system, Handle* out_handle, | 333 | static ResultCode ConnectToNamedPort(Core::System& system, Handle* out_handle, |
| 334 | VAddr port_name_address) { | 334 | VAddr port_name_address) { |
| 335 | if (!system.Memory().IsValidVirtualAddress(port_name_address)) { | 335 | auto& memory = system.Memory(); |
| 336 | |||
| 337 | if (!memory.IsValidVirtualAddress(port_name_address)) { | ||
| 336 | LOG_ERROR(Kernel_SVC, | 338 | LOG_ERROR(Kernel_SVC, |
| 337 | "Port Name Address is not a valid virtual address, port_name_address=0x{:016X}", | 339 | "Port Name Address is not a valid virtual address, port_name_address=0x{:016X}", |
| 338 | port_name_address); | 340 | port_name_address); |
| @@ -341,7 +343,7 @@ static ResultCode ConnectToNamedPort(Core::System& system, Handle* out_handle, | |||
| 341 | 343 | ||
| 342 | static constexpr std::size_t PortNameMaxLength = 11; | 344 | static constexpr std::size_t PortNameMaxLength = 11; |
| 343 | // Read 1 char beyond the max allowed port name to detect names that are too long. | 345 | // Read 1 char beyond the max allowed port name to detect names that are too long. |
| 344 | std::string port_name = Memory::ReadCString(port_name_address, PortNameMaxLength + 1); | 346 | const std::string port_name = memory.ReadCString(port_name_address, PortNameMaxLength + 1); |
| 345 | if (port_name.size() > PortNameMaxLength) { | 347 | if (port_name.size() > PortNameMaxLength) { |
| 346 | LOG_ERROR(Kernel_SVC, "Port name is too long, expected {} but got {}", PortNameMaxLength, | 348 | LOG_ERROR(Kernel_SVC, "Port name is too long, expected {} but got {}", PortNameMaxLength, |
| 347 | port_name.size()); | 349 | port_name.size()); |