projects
/
platform
/
upstream
/
freerdp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e45ebd8
)
Fixed GetComputerNameExA and GetComputerNameA.
author
Armin Novak
<armin.novak@gmail.com>
Tue, 25 Aug 2015 15:43:22 +0000
(17:43 +0200)
committer
Armin Novak
<armin.novak@gmail.com>
Tue, 25 Aug 2015 15:43:22 +0000
(17:43 +0200)
winpr/libwinpr/sysinfo/sysinfo.c
patch
|
blob
|
history
diff --git
a/winpr/libwinpr/sysinfo/sysinfo.c
b/winpr/libwinpr/sysinfo/sysinfo.c
index
7f1dfd2
..
3859dcf
100644
(file)
--- a/
winpr/libwinpr/sysinfo/sysinfo.c
+++ b/
winpr/libwinpr/sysinfo/sysinfo.c
@@
-188,16
+188,15
@@
BOOL GetComputerNameA(LPSTR lpBuffer, LPDWORD lpnSize)
if (dot)
length = dot - hostname;
- if (!lpBuffer)
- return FALSE;
-
if (*lpnSize <= length)
{
SetLastError(ERROR_BUFFER_OVERFLOW);
- *lpnSize = length;
+ *lpnSize = length
+ 1
;
return FALSE;
}
+ if (!lpBuffer)
+ return FALSE;
CopyMemory(lpBuffer, hostname, length);
lpBuffer[length] = '\0';
@@
-227,7
+226,8
@@
BOOL GetComputerNameExA(COMPUTER_NAME_FORMAT NameType, LPSTR lpBuffer, LPDWORD l
case ComputerNamePhysicalDnsFullyQualified:
if (*lpnSize <= length)
{
- *lpnSize = length;
+ *lpnSize = length + 1;
+ SetLastError(ERROR_MORE_DATA);
return FALSE;
}