[NETSHELL] Fix buffer size parameter (#8802)

Change szFormat to szBuffer in StrFormatByteSizeW calls.
Using szFormat is incorrect and could cause buffer overflow if buffer sizes differ.
This commit is contained in:
Alex Mendoza
2026-03-29 21:35:48 +02:00
committed by GitHub
parent dfaac47afc
commit 2c57d695da

View File

@@ -70,12 +70,12 @@ UpdateLanStatusUiDlg(
}
}
if (StrFormatByteSizeW(IfEntry->dwInOctets, szBuffer, sizeof(szFormat)/sizeof(WCHAR)))
if (StrFormatByteSizeW(IfEntry->dwInOctets, szBuffer, _countof(szBuffer)))
{
SendDlgItemMessageW(hwndDlg, IDC_RECEIVED, WM_SETTEXT, 0, (LPARAM)szBuffer);
}
if (StrFormatByteSizeW(IfEntry->dwOutOctets, szBuffer, sizeof(szFormat)/sizeof(WCHAR)))
if (StrFormatByteSizeW(IfEntry->dwOutOctets, szBuffer, _countof(szBuffer)))
{
SendDlgItemMessageW(hwndDlg, IDC_SEND, WM_SETTEXT, 0, (LPARAM)szBuffer);
}