1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-29 08:08:37 +00:00

ndis(4): unsign some indexes to prevent overflows.

The "len" parameter is uint32_t, indexing it with an int may
end up in a signed integer overflow.

strlen(3) returns an integer of size_t so the corresponding index should
have that size.

MFC after:	1 week
This commit is contained in:
Pedro F. Giffuni 2016-04-28 01:58:56 +00:00
parent 9b436b180c
commit 9119df34df
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=298731

View File

@ -896,7 +896,7 @@ NdisReadPciSlotInformation(adapter, slot, offset, buf, len)
uint32_t len;
{
ndis_miniport_block *block;
int i;
uint32_t i;
char *dest;
device_t dev;
@ -939,7 +939,7 @@ NdisWritePciSlotInformation(adapter, slot, offset, buf, len)
uint32_t len;
{
ndis_miniport_block *block;
int i;
uint32_t i;
char *dest;
device_t dev;
@ -2432,7 +2432,7 @@ NdisReadPcmciaAttributeMemory(handle, offset, buf, len)
bus_space_handle_t bh;
bus_space_tag_t bt;
char *dest;
int i;
uint32_t i;
if (handle == NULL)
return (0);
@ -2462,7 +2462,7 @@ NdisWritePcmciaAttributeMemory(handle, offset, buf, len)
bus_space_handle_t bh;
bus_space_tag_t bt;
char *src;
int i;
uint32_t i;
if (handle == NULL)
return (0);
@ -2670,7 +2670,7 @@ ndis_find_sym(lf, filename, suffix, sym)
{
char *fullsym;
char *suf;
int i;
size_t i;
fullsym = ExAllocatePoolWithTag(NonPagedPool, MAXPATHLEN, 0);
if (fullsym == NULL)