Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/plugin/AdblockPlusClient.cpp

Issue 6237450183639040: Issue 1283 - wrong usage of memset, fix sizeof, make proper initializing (Closed)
Patch Set: Created Sept. 1, 2014, 11:52 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 #include "PluginStdAfx.h" 1 #include "PluginStdAfx.h"
2 #include "PluginSettings.h" 2 #include "PluginSettings.h"
3 #include "PluginSystem.h" 3 #include "PluginSystem.h"
4 #include "PluginFilter.h" 4 #include "PluginFilter.h"
5 #include "PluginClientFactory.h" 5 #include "PluginClientFactory.h"
6 #include "PluginMutex.h" 6 #include "PluginMutex.h"
7 #include "PluginClass.h" 7 #include "PluginClass.h"
8 8
9 #include "AdblockPlusClient.h" 9 #include "AdblockPlusClient.h"
10 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 PSID integritySid = 0; 58 PSID integritySid = 0;
59 ConvertStringSidToSid(L"S-1-16-4096", &integritySid); 59 ConvertStringSidToSid(L"S-1-16-4096", &integritySid);
60 std::tr1::shared_ptr<SID> sharedIntegritySid(static_cast<SID*>(integritySi d), FreeSid); // Just to simplify cleanup 60 std::tr1::shared_ptr<SID> sharedIntegritySid(static_cast<SID*>(integritySi d), FreeSid); // Just to simplify cleanup
61 61
62 TOKEN_MANDATORY_LABEL tml = {}; 62 TOKEN_MANDATORY_LABEL tml = {};
63 tml.Label.Attributes = SE_GROUP_INTEGRITY; 63 tml.Label.Attributes = SE_GROUP_INTEGRITY;
64 tml.Label.Sid = integritySid; 64 tml.Label.Sid = integritySid;
65 65
66 // Set the process integrity level 66 // Set the process integrity level
67 SetTokenInformation(newToken, TokenIntegrityLevel, &tml, sizeof(TOKEN_MAND ATORY_LABEL) + GetLengthSid(integritySid)); 67 SetTokenInformation(newToken, TokenIntegrityLevel, &tml, sizeof(tml));
68 68
69 STARTUPINFO startupInfo = {}; 69 STARTUPINFO startupInfo = {};
70 PROCESS_INFORMATION processInformation = {}; 70 PROCESS_INFORMATION processInformation = {};
71 71
72 createProcRes = CreateProcessAsUserW(newToken, engineExecutablePath.c_str( ), params.GetBuffer(params.GetLength() + 1), 72 createProcRes = CreateProcessAsUserW(newToken, engineExecutablePath.c_str( ), params.GetBuffer(params.GetLength() + 1),
73 0, 0, false, 0, 0, 0, (STARTUPINFOW*)&startupInfo, &processInformation); 73 0, 0, false, 0, 0, 0, (STARTUPINFOW*)&startupInfo, &processInformation);
74 } 74 }
75 75
76 if (!createProcRes) 76 if (!createProcRes)
77 { 77 {
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 DEBUG_GENERAL("CompareVersions"); 578 DEBUG_GENERAL("CompareVersions");
579 Communication::OutputBuffer request; 579 Communication::OutputBuffer request;
580 request << Communication::PROC_COMPARE_VERSIONS << ToUtf8String(v1) << ToUtf8S tring(v2); 580 request << Communication::PROC_COMPARE_VERSIONS << ToUtf8String(v1) << ToUtf8S tring(v2);
581 Communication::InputBuffer response; 581 Communication::InputBuffer response;
582 if (!CallEngine(request, response)) 582 if (!CallEngine(request, response))
583 return 0; 583 return 0;
584 int result; 584 int result;
585 response >> result; 585 response >> result;
586 return result; 586 return result;
587 } 587 }
OLDNEW

Powered by Google App Engine
This is Rietveld