mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 08:23:01 +00:00
- We only need 11 chars to hold our 32-bit integer and the trailing NULL char
- Make sure we don't overread our buffer svn path=/trunk/; revision=41589
This commit is contained in:
parent
42e13d3260
commit
d516d6898c
1 changed files with 4 additions and 3 deletions
|
@ -65,7 +65,7 @@ NdisWriteConfiguration(
|
||||||
ULONG ParameterType;
|
ULONG ParameterType;
|
||||||
ULONG DataSize;
|
ULONG DataSize;
|
||||||
PVOID Data;
|
PVOID Data;
|
||||||
WCHAR Buff[25];
|
WCHAR Buff[11];
|
||||||
|
|
||||||
NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
|
NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
|
||||||
|
|
||||||
|
@ -86,6 +86,7 @@ NdisWriteConfiguration(
|
||||||
ParameterValue->ParameterData.IntegerData,
|
ParameterValue->ParameterData.IntegerData,
|
||||||
(ParameterValue->ParameterType == NdisParameterInteger) ? 10 : 16, &Str)))
|
(ParameterValue->ParameterType == NdisParameterInteger) ? 10 : 16, &Str)))
|
||||||
{
|
{
|
||||||
|
NDIS_DbgPrint(MIN_TRACE, ("RtlIntegerToUnicodeString failed (%x)\n", *Status));
|
||||||
*Status = NDIS_STATUS_FAILURE;
|
*Status = NDIS_STATUS_FAILURE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -674,7 +675,7 @@ NdisReadNetworkAddress(
|
||||||
|
|
||||||
if (ParameterValue->ParameterType == NdisParameterInteger)
|
if (ParameterValue->ParameterType == NdisParameterInteger)
|
||||||
{
|
{
|
||||||
WCHAR Buff[25];
|
WCHAR Buff[11];
|
||||||
|
|
||||||
NDIS_DbgPrint(MAX_TRACE, ("Read integer data %lx\n",
|
NDIS_DbgPrint(MAX_TRACE, ("Read integer data %lx\n",
|
||||||
ParameterValue->ParameterData.IntegerData));
|
ParameterValue->ParameterData.IntegerData));
|
||||||
|
@ -702,7 +703,7 @@ NdisReadNetworkAddress(
|
||||||
str = ParameterValue->ParameterData.StringData;
|
str = ParameterValue->ParameterData.StringData;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (str.Buffer[j] != '\0') j++;
|
while (str.Buffer[j] != '\0' && j < str.Length) j++;
|
||||||
|
|
||||||
*NetworkAddressLength = (UINT)((j/2)+0.5);
|
*NetworkAddressLength = (UINT)((j/2)+0.5);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue