Closed GoogleCodeExporter closed 9 years ago
I've tried to debug this a little and it seems the problem occurs when building
the username string:
/* Build the full username string. */
fullName = malloc(( + 1 + nameSize + 1) * sizeof(TCHAR));
memcpy(fullName, domainName, domainNameSize);
fullName[domainNameSize] = '\\';
memcpy(&fullName[domainNameSize + 1], name, nameSize);
fullName[domainNameSize + 1 + nameSize] = '\0';
This change seems to fix the issue:
- fullName = malloc(( + 1 + nameSize + 1) * sizeof(TCHAR));
+ fullName = malloc(( + 1 + nameSize + 1) * sizeof(PSTR));
Original comment by g.rodola
on 10 Oct 2010 at 10:20
Committed in r669.
I've also added a credits file to mention wj32 cotribution:
http://psutil.googlecode.com/svn-history/r669/trunk/CREDITS
I'm not sure if he's gonna read this but me and Jay really appreciated the work
he has done. Thanks a lot.
Original comment by g.rodola
on 10 Oct 2010 at 11:08
Sorry, the patch I submitted has a memory leak. In the second "if
(!GetTokenInformation(..." there needs to be a "free(user);".
Also, the crash occurs because space isn't reserved for the domain name.
Somehow I left it out - that line needs to be:
fullName = malloc((domainNameSize + 1 + nameSize + 1) * sizeof(TCHAR));
Original comment by wj32...@gmail.com
on 11 Oct 2010 at 5:40
wj32, would you be interested in having commit access and/or become a project
member?
Me and Jay are more focused on UNIX development and a Windows expert would be
great to have.
Original comment by g.rodola
on 11 Oct 2010 at 7:53
No, I have my own project (Process Hacker) to run ;) Anyway, I don't know
enough Python to be of much use to you guys. I would however be glad to help
out with anything that needs adding/fixing.
Original comment by wj32...@gmail.com
on 11 Oct 2010 at 8:00
Ok, I'm going to CC you in new tickets involving Windows development then.
Thanks again for your help.
Original comment by g.rodola
on 11 Oct 2010 at 10:17
[deleted comment]
Updated csets after the SVN -> Mercurial migration:
r669 == revision c6c27fae9599
Original comment by g.rodola
on 2 Mar 2013 at 11:55
Original issue reported on code.google.com by
g.rodola
on 10 Oct 2010 at 8:53Attachments: