Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static NTSTATUS APIENTRY
- DxgkDdiRenderNew(CONST HANDLE hContext, DXGKARG_RENDER *pRender)
- {
- ....
- NTSTATUS Status = STATUS_SUCCESS; //<==
- __try
- {
- ....
- NTSTATUS Status = STATUS_SUCCESS; //<==
- ....
- }
- __except (EXCEPTION_EXECUTE_HANDLER)
- {
- Status = STATUS_INVALID_PARAMETER;
- WARN(("invalid parameter"));
- }
- return Status;
- }
- Any change of the variable within the try..except section won't change the returned value and the external (in relation to the try {} block) variable will be changed only if an exception occurs.
- This suspicious code was found in VirtualBox project by PVS-Studio static code analyzer.
- Warning message is:
- V561 It's probably better to assign value to 'Status' variable than to declare it anew. Previous declaration: vboxmpwddm.cpp, line 5723. vboxmpwddm.cpp 5728
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment