mirror of
https://github.com/azahar-emu/azahar.git
synced 2026-06-06 02:33:44 -04:00
fix: don't crash when getaddrinfo gets a small or empty buffer in soc:U
* those are valid in hw!
This commit is contained in:
parent
901f010913
commit
3066887ff4
1 changed files with 1 additions and 1 deletions
|
|
@ -2078,7 +2078,7 @@ void SOC_U::GetAddrInfoImpl(Kernel::HLERequestContext& ctx) {
|
||||||
std::size_t pos = 0;
|
std::size_t pos = 0;
|
||||||
addrinfo* cur = out;
|
addrinfo* cur = out;
|
||||||
while (cur != nullptr) {
|
while (cur != nullptr) {
|
||||||
if (pos <= out_size - sizeof(CTRAddrInfo)) {
|
if (sizeof(CTRAddrInfo) <= out_size - pos) {
|
||||||
// According to 3dbrew, this function fills whatever it can and does not error even
|
// According to 3dbrew, this function fills whatever it can and does not error even
|
||||||
// if the buffer is not big enough. However the count returned is always correct.
|
// if the buffer is not big enough. However the count returned is always correct.
|
||||||
CTRAddrInfo ctr_addr = CTRAddrInfo::FromPlatform(*cur);
|
CTRAddrInfo ctr_addr = CTRAddrInfo::FromPlatform(*cur);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue