Added test for buffer not having enough space to write computer name

This commit is contained in:
Aaron committed 2015-07-30 13:47:31 -07:00
1 parent b8ae6d13a9
commit 4661081c7d
2 files changed
+7 -4

No files matched your search

+2 -2
View File
@@ -5,8 +5,8 @@
BOOL GetComputerName(LPTSTR name, LPDWORD len)
{
errno = 0;
int host = gethostname(name, HOST_NAME_MAX);
size_t len2 = *len;
int host = gethostname(name, len2);
if(host == 0)
{
return TRUE;