mirror of
https://github.com/reactos/reactos.git
synced 2024-09-30 14:37:45 +00:00
[RTL]
- Handle a NULL buffer in RtlIpv4AddressToStringA as Windows does. Fixes crash in ntdll:rtl test [CRT] - Fail on qsort with 0 size. Fixes hang in ntdll:string test svn path=/trunk/; revision=54093
This commit is contained in:
parent
0f71d87a65
commit
b98f465c6d
|
@ -22,10 +22,15 @@ NTAPI
|
|||
RtlIpv4AddressToStringA(IN struct in_addr *Addr,
|
||||
OUT PCHAR S)
|
||||
{
|
||||
return S + sprintf(S, "%u.%u.%u.%u", Addr->S_un.S_un_b.s_b1,
|
||||
CHAR Buffer[sizeof("255.255.255.255")];
|
||||
INT Length;
|
||||
Length = sprintf(Buffer, "%u.%u.%u.%u", Addr->S_un.S_un_b.s_b1,
|
||||
Addr->S_un.S_un_b.s_b2,
|
||||
Addr->S_un.S_un_b.s_b3,
|
||||
Addr->S_un.S_un_b.s_b4);
|
||||
if (S)
|
||||
strcpy(S, Buffer);
|
||||
return S + Length;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -186,7 +186,8 @@ qsort(void *base0, size_t n, size_t size, int (__cdecl *compar)(const void*, con
|
|||
if (n <= 1)
|
||||
return;
|
||||
|
||||
size = size;
|
||||
if (size == 0)
|
||||
return;
|
||||
compar = compar;
|
||||
thresh = size * THRESH;
|
||||
max = base + n * size;
|
||||
|
|
Loading…
Reference in a new issue