Crash in Registry.cpp - "Run-Time Check Failure #2 - Stack around the variable 'lpstrData' was corrupted."
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OCS Inventory: Windows Agent |
Fix Released
|
Low
|
Didier Liroulet |
Bug Description
I've built the agent on Windows 7 and encounter a crash in CRegistry:
Look at the code:-
DWORD dwSize = 256;
TCHAR lpstrData[256];
DWORD dwResult;
dwResult = VerLanguageName( dwLanguage, lpstrData, dwSize);
if ((dwResult != 0) && (dwResult < dwSize - 1))
{
lpstrData
csLanguage = lpstrData;
}
There's also the same code in CRegistry:
The line "lpstrData[
Actually, I think the line can be removed altogether because VerLanguageName() already null-terminated the result. I've tried so and it is OK. It've attached the patch to show my idea.
Related branches
Changed in ocsinventory-windows-agent: | |
status: | Fix Committed → Fix Released |
Hi.
You're right.
I fix it for next release.
Thanks a lot for the report.
Cheers