projects
/
occt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8e3006e
)
OCC22360 Writing out of allocated memory in the method OSD_FontMgr::InitFontDataBase
author
MSV
<>
Thu, 28 Apr 2011 15:16:31 +0000
(15:16 +0000)
committer
bugmaster
<bugmaster@opencascade.com>
Mon, 5 Mar 2012 15:27:55 +0000
(19:27 +0400)
src/OSD/OSD_FontMgr.cxx
patch
|
blob
|
blame
|
history
diff --git
a/src/OSD/OSD_FontMgr.cxx
b/src/OSD/OSD_FontMgr.cxx
index
8756666
..
adec9c2
100755
(executable)
--- a/
src/OSD/OSD_FontMgr.cxx
+++ b/
src/OSD/OSD_FontMgr.cxx
@@
-118,7
+118,7
@@
void OSD_FontMgr::InitFontDataBase() {
Standard_Size req_size;
req_size = strlen( getenv("windir") );
Standard_Size req_size;
req_size = strlen( getenv("windir") );
- windir_var = new Standard_Character[req_size];
+ windir_var = new Standard_Character[req_size
+ 1
];
strcpy( windir_var, getenv("windir") );
strcpy( windir_var, getenv("windir") );
@@
-238,15
+238,10
@@
void OSD_FontMgr::InitFontDataBase() {
Handle(TCollection_HAsciiString) str = new TCollection_HAsciiString;
Display * disp = XOpenDisplay("localhost:0.0");
Handle(TCollection_HAsciiString) str = new TCollection_HAsciiString;
Display * disp = XOpenDisplay("localhost:0.0");
- if (
!disp
)
+ if (
!disp
)
{
{
- // let the X server find the available connection
- disp = XOpenDisplay(":0.0");
- if (!disp)
- {
- cout << "Display is NULL!" << endl;
- return ;
- }
+ cout << "Display is NULL!" << endl;
+ return ;
}
Standard_Integer npaths = 0;
}
Standard_Integer npaths = 0;