mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 21:36:11 +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
|
@ -32,6 +32,8 @@ RtlIpv4AddressToStringA(IN struct in_addr *Addr,
|
|||
OUT PCHAR S)
|
||||
{
|
||||
INT Length;
|
||||
|
||||
if (!S) return (LPSTR)~0;
|
||||
|
||||
Length = sprintf(S, "%u.%u.%u.%u", Addr->S_un.S_un_b.s_b1,
|
||||
Addr->S_un.S_un_b.s_b2,
|
||||
|
@ -85,6 +87,8 @@ RtlIpv4AddressToStringW(IN struct in_addr *Addr,
|
|||
{
|
||||
INT Length;
|
||||
|
||||
if (!S) return (LPWSTR)~0;
|
||||
|
||||
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_b3,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue