Author: akhaldi
Date: Sun Mar 1 22:35:47 2015
New Revision: 66529
URL:
http://svn.reactos.org/svn/reactos?rev=66529&view=rev
Log:
[NOTEPAD] Fix CIDs 510916 and 716307. By Ricardo Hanke. CORE-9300
Modified:
trunk/reactos/base/applications/notepad/dialog.c
trunk/reactos/base/applications/notepad/main.c
Modified: trunk/reactos/base/applications/notepad/dialog.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/notepad/…
==============================================================================
--- trunk/reactos/base/applications/notepad/dialog.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/notepad/dialog.c [iso-8859-1] Sun Mar 1 22:35:47
2015
@@ -983,6 +983,11 @@
if (Globals.hEdit == NULL)
{
+ if (pTemp)
+ {
+ HeapFree(GetProcessHeap(), 0, pTemp);
+ }
+
ShowLastError();
return;
}
Modified: trunk/reactos/base/applications/notepad/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/notepad/…
==============================================================================
--- trunk/reactos/base/applications/notepad/main.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/notepad/main.c [iso-8859-1] Sun Mar 1 22:35:47 2015
@@ -24,6 +24,8 @@
#include "notepad.h"
+#include <strsafe.h>
+
NOTEPAD_GLOBALS Globals;
static ATOM aFINDMSGSTRING;
@@ -43,7 +45,7 @@
*/
VOID SetFileName(LPCTSTR szFileName)
{
- _tcscpy(Globals.szFileName, szFileName);
+ StringCchCopy(Globals.szFileName, SIZEOF(Globals.szFileName), szFileName);
Globals.szFileTitle[0] = 0;
GetFileTitle(szFileName, Globals.szFileTitle, SIZEOF(Globals.szFileTitle));
}