Skip to content

Commit fb28a47

Browse files
committed
Fix Ip6ReverseName buffer length
1 parent f63d84c commit fb28a47

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ProcessHacker/netprv.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ PPH_STRING PhpGetIp6ReverseNameFromAddress(
371371
{
372372
PH_STRING_BUILDER stringBuilder;
373373

374-
PhInitializeStringBuilder(&stringBuilder, 32);
374+
PhInitializeStringBuilder(&stringBuilder, DNS_MAX_NAME_BUFFER_LENGTH);
375375

376376
for (INT i = sizeof(IN6_ADDR) - 1; i >= 0; i--)
377377
{
@@ -753,10 +753,10 @@ VOID PhNetworkProviderUpdate(
753753
PROCESS_EXTENDED_BASIC_INFORMATION basicInfo;
754754

755755
// HACK HACK HACK
756-
// WSL subsystem processes (e.g. nginx) create sockets, clone/fork themselves, duplicate the socket into the child process and then terminate.
756+
// WSL subsystem processes (e.g. apache/nginx) create sockets, clone/fork themselves, duplicate the socket into the child process and then terminate.
757757
// The socket handle remains valid and in-use by the child process BUT the socket continues returning the PID of the exited process???
758758
// Fixing this causes a major performance problem; If we have 100,000 sockets then on previous versions of Windows we would only need 2 system calls maximum
759-
// (for the process list) to identify the owner of every socket but now we need to make 4 system calls for every_last_socket totaling 400,000 system calls... great.
759+
// (for the process list) to identify the owner of every socket but now we need to make 4 system calls for every_last_socket totaling 400,000 system calls... great. (dmex)
760760
if (NT_SUCCESS(PhOpenProcess(&processHandle, PROCESS_QUERY_LIMITED_INFORMATION, networkItem->ProcessId)))
761761
{
762762
if (NT_SUCCESS(PhGetProcessExtendedBasicInformation(processHandle, &basicInfo)))
@@ -768,7 +768,7 @@ VOID PhNetworkProviderUpdate(
768768
{
769769
PhMoveReference(&networkItem->ProcessName, PhGetBaseName(fileName));
770770
}
771-
771+
772772
NtClose(processHandle);
773773
}
774774

0 commit comments

Comments
 (0)