mirror of
https://github.com/reactos/reactos.git
synced 2026-05-31 16:31:07 +08:00
[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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user