Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed from PVS-Studio #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DialogFeatures/DockingDlgInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class DockingDlgInterface : public StaticDialog

void create(tTbData * data, bool isRTL = false){
StaticDialog::create(_dlgID, isRTL);
::GetWindowText(_hSelf, _pluginName, sizeof(_pluginName));
::GetWindowText(_hSelf, _pluginName, sizeof(_pluginName)/sizeof(TCHAR));

// user information
data->hClient = _hSelf;
Expand Down
19 changes: 10 additions & 9 deletions PluginDefinition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ void insertSnippet()
diagActivate(tempTriggerText);
::SetFocus(::getCurrentScintilla());

delete[] tempScope;
}


Expand Down Expand Up @@ -1692,7 +1692,7 @@ void evaluateHotSpot(int &firstPos, char* hotSpotText)
//secondPos = secondPos - (delimitEnd + 2 - (firstPos + 5));

}
} if (strncmp(hotSpotText,"TERNARY'",8) == 0)
} else if (strncmp(hotSpotText,"TERNARY'",8) == 0)
{
mode = 0;

Expand Down Expand Up @@ -5610,14 +5610,9 @@ void httpToFile(TCHAR* server, TCHAR* request, TCHAR* requestType, TCHAR* pathWi
}

// Allocate space for the buffer.
pszOutBuffer = new char[dwSize+1];
try {
pszOutBuffer = new char[dwSize+1];

if (!pszOutBuffer)
{
showMessageBox(TEXT("Out of memory."));
dwSize=0;
} else
{
// Read the Data.
ZeroMemory(pszOutBuffer, dwSize+1);

Expand All @@ -5632,6 +5627,12 @@ void httpToFile(TCHAR* server, TCHAR* request, TCHAR* requestType, TCHAR* pathWi
// Free the memory allocated to the buffer.
delete [] pszOutBuffer;
}
catch (const std::bad_alloc& e)
{
showMessageBox(TEXT("Out of memory."));
dwSize = 0;
}

} while (dwSize>0);
}
fclose (pFile);
Expand Down