mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 03:46:38 +00:00
[RTL]: Force RtlIpToString APIs to behave inexplicably like on Windows, returning -1 instead of crashing when sprintfing to a NULL pointer.
svn path=/trunk/; revision=55733
This commit is contained in:
parent
d3418a128b
commit
62930b0461
1 changed files with 4 additions and 0 deletions
|
@ -33,6 +33,8 @@ RtlIpv4AddressToStringA(IN struct in_addr *Addr,
|
||||||
{
|
{
|
||||||
INT Length;
|
INT Length;
|
||||||
|
|
||||||
|
if (!S) return (LPSTR)~0;
|
||||||
|
|
||||||
Length = sprintf(S, "%u.%u.%u.%u", Addr->S_un.S_un_b.s_b1,
|
Length = sprintf(S, "%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_b2,
|
||||||
Addr->S_un.S_un_b.s_b3,
|
Addr->S_un.S_un_b.s_b3,
|
||||||
|
@ -85,6 +87,8 @@ RtlIpv4AddressToStringW(IN struct in_addr *Addr,
|
||||||
{
|
{
|
||||||
INT Length;
|
INT Length;
|
||||||
|
|
||||||
|
if (!S) return (LPWSTR)~0;
|
||||||
|
|
||||||
Length = swprintf(S, L"%u.%u.%u.%u", Addr->S_un.S_un_b.s_b1,
|
Length = swprintf(S, L"%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_b2,
|
||||||
Addr->S_un.S_un_b.s_b3,
|
Addr->S_un.S_un_b.s_b3,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue