FObject double free prevention of fc::empty_string
This commit is contained in:
parent
af2caf8fcf
commit
1cb6a5f73d
|
@ -1,3 +1,6 @@
|
|||
2017-10-15 Markus Gans <guru.mail@muenster.de>
|
||||
* FObject double free prevention of fc::empty_string
|
||||
|
||||
2017-10-14 Markus Gans <guru.mail@muenster.de>
|
||||
* Fixed a bug in the FObject check of parent objects
|
||||
* Replace the deprecated readdir_r function (CVE-2013-4237)
|
||||
|
|
|
@ -182,11 +182,11 @@ void Listview::cb_showInMessagebox (FWidget* widget, data_ptr)
|
|||
{
|
||||
FListView* listView = static_cast<FListView*>(widget);
|
||||
FListViewItem* item = listView->getCurrentItem();
|
||||
FMessageBox info ( "Weather in " + item->getText(0)
|
||||
, " Condition: " + item->getText(1) + "\n"
|
||||
"Temperature: " + item->getText(2) + "\n"
|
||||
" Humidity: " + item->getText(3) + "\n"
|
||||
" Pressure: " + item->getText(4)
|
||||
FMessageBox info ( "Weather in " + item->getText(1)
|
||||
, " Condition: " + item->getText(2) + "\n"
|
||||
"Temperature: " + item->getText(3) + "\n"
|
||||
" Humidity: " + item->getText(4) + "\n"
|
||||
" Pressure: " + item->getText(5)
|
||||
, FMessageBox::Ok, 0, 0, this );
|
||||
info.show();
|
||||
}
|
||||
|
|
|
@ -266,12 +266,6 @@ Treeview::Treeview (FWidget* parent)
|
|||
continent_list++;
|
||||
}
|
||||
|
||||
FObjectIterator iter = listView->beginOfList();
|
||||
FObjectIterator iter_africa = iter++;
|
||||
FListViewItem* item_africa = static_cast<FListViewItem*>(*iter_africa);
|
||||
item_africa->expand();
|
||||
|
||||
|
||||
// Quit button
|
||||
Quit = new FButton (this);
|
||||
Quit->setGeometry(24, 16, 10, 1);
|
||||
|
|
|
@ -38,10 +38,12 @@ FObject::FObject (FObject* parent)
|
|||
, children_list() // no children yet
|
||||
, has_parent(false)
|
||||
{
|
||||
if ( parent_obj ) // add object to parent
|
||||
parent_obj->addChild(this);
|
||||
|
||||
if ( parent == 0 )
|
||||
if ( parent ) // add object to parent
|
||||
{
|
||||
parent->addChild(this);
|
||||
has_parent = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
timer_modify_lock = false;
|
||||
|
||||
|
@ -71,17 +73,11 @@ FObject::FObject (FObject* parent)
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
has_parent = true;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
FObject::~FObject() // destructor
|
||||
{
|
||||
if ( parent_obj )
|
||||
parent_obj->delChild(this);
|
||||
|
||||
parent_obj = 0;
|
||||
delOwnTimer(); // delete all timers of this object
|
||||
|
||||
if ( ! has_parent && timer_list )
|
||||
|
@ -110,6 +106,11 @@ FObject::~FObject() // destructor
|
|||
++iter;
|
||||
}
|
||||
}
|
||||
|
||||
if ( parent_obj )
|
||||
parent_obj->delChild(this);
|
||||
|
||||
parent_obj = 0;
|
||||
}
|
||||
|
||||
// public methods of FObject
|
||||
|
|
|
@ -2482,13 +2482,13 @@ inline void FString::_assign (const wchar_t* s)
|
|||
//----------------------------------------------------------------------
|
||||
inline void FString::_insert (uInt pos, uInt len, const wchar_t* s)
|
||||
{
|
||||
if ( len == 0 ) // String s is a null or a empty string
|
||||
return;
|
||||
|
||||
if ( ! string )
|
||||
{
|
||||
// string is null
|
||||
|
||||
if ( len == 0 ) // String s is also a null string
|
||||
return;
|
||||
|
||||
length = len;
|
||||
bufsize = FWDBUFFER + length + 1;
|
||||
|
||||
|
|
Loading…
Reference in New Issue