From 19012a1efce57658790cd73f536fbdbef1a795f3 Mon Sep 17 00:00:00 2001 From: Zangetsu38 Date: Wed, 19 Nov 2025 08:57:14 +0100 Subject: [PATCH] modules/SceNetCtl: Fix IP/netmask in InetGetInfo by copy string. - info->(ip_address/netmask) correctly hold the complete IP/netmask strings. --- vita3k/modules/SceNetCtl/SceNetCtl.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vita3k/modules/SceNetCtl/SceNetCtl.cpp b/vita3k/modules/SceNetCtl/SceNetCtl.cpp index e5c0c5178..4f0995b64 100644 --- a/vita3k/modules/SceNetCtl/SceNetCtl.cpp +++ b/vita3k/modules/SceNetCtl/SceNetCtl.cpp @@ -577,10 +577,12 @@ EXPORT(int, sceNetCtlInetGetInfo, int code, SceNetCtlInfo *info) { // STUBBED("code SCE_NETCTL_INFO_GET_RSSI_PERCENTAGE return 100%"); break; case SCE_NETCTL_INFO_GET_IP_ADDRESS: - inet_pton(AF_INET, addr.addr.c_str(), &info->ip_address); + std::strncpy(info->ip_address, addr.addr.c_str(), sizeof(info->ip_address) - 1); + info->ip_address[sizeof(info->ip_address) - 1] = '\0'; break; case SCE_NETCTL_INFO_GET_NETMASK: - inet_pton(AF_INET, addr.netMask.c_str(), &info->netmask); + std::strncpy(info->netmask, addr.netMask.c_str(), sizeof(info->netmask) - 1); + info->netmask[sizeof(info->netmask) - 1] = '\0'; break; default: switch (code) {