Skip to content

Commit f911443

Browse files
SergeGautherielearn-more
authored andcommitted
[TASKMGR] CachedGetUserFromSid(): Fix user name length on cache hit
1 parent 353b544 commit f911443

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

base/applications/taskmgr/perfdata.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,16 @@ CachedGetUserFromSid(
144144
if (EqualSid((PSID)&pEntry->Data, pSid))
145145
{
146146
wcsncpy(pUserName, pEntry->pszName, cwcUserName);
147-
*pcwcUserName = cwcUserName;
147+
*pcwcUserName = wcslen(pUserName);
148148
return;
149149
}
150150
}
151151

152152
/* We didn't find the SID in the list, get the name conventional */
153153
SidToUserName(pSid, pUserName, cwcUserName);
154+
*pcwcUserName = wcslen(pUserName);
154155

155156
/* Allocate a new entry */
156-
*pcwcUserName = wcslen(pUserName);
157157
cwcUserName = *pcwcUserName + 1;
158158
cbSid = GetLengthSid(pSid);
159159
pEntry = HeapAlloc(GetProcessHeap(), 0, sizeof(SIDTOUSERNAME) + cbSid + cwcUserName * sizeof(WCHAR));

0 commit comments

Comments
 (0)