kernel32: Fix an off-by-one error in GetComputerNameExA/W.

The dns_* functions expect the input buffer to have space for size 
characters plus the nul terminating character.
This commit is contained in:
Rob Shearman 2007-02-21 17:13:25 +00:00 committed by Alexandre Julliard
parent ba590a185a
commit a5317eb846
1 changed files with 2 additions and 2 deletions

View File

@ -406,7 +406,7 @@ BOOL WINAPI GetComputerNameA(LPSTR name, LPDWORD size)
BOOL WINAPI GetComputerNameExA(COMPUTER_NAME_FORMAT type, LPSTR name, LPDWORD size)
{
char buf[256];
int len = sizeof (buf), ret;
int len = sizeof(buf) - 1, ret;
TRACE("%d, %p, %p\n", type, name, size);
switch( type )
{
@ -458,7 +458,7 @@ BOOL WINAPI GetComputerNameExA(COMPUTER_NAME_FORMAT type, LPSTR name, LPDWORD si
BOOL WINAPI GetComputerNameExW( COMPUTER_NAME_FORMAT type, LPWSTR name, LPDWORD size )
{
char buf[256];
int len = sizeof (buf), ret;
int len = sizeof(buf) - 1, ret;
TRACE("%d, %p, %p\n", type, name, size);
switch( type )