mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 08:21:07 +02:00
fix possible segfault if ID value is bigger than MN_WIDGET_ID_MAX
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1927 e54a6e83-5905-42d5-8d5c-058d10e6a962
Origin commit data
------------------
Branch: ni/coolstream
Commit: 2c8073dfd8
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2011-11-29 (Tue, 29 Nov 2011)
Origin message was:
------------------
-fix possible segfault if ID value is bigger than MN_WIDGET_ID_MAX
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1927 e54a6e83-5905-42d5-8d5c-058d10e6a962
------------------
This commit was generated by Migit
This commit is contained in:
@@ -332,7 +332,15 @@ void CMenuWidget::Init(const std::string & Icon, const int mwidth, const mn_widg
|
|||||||
iconfile = Icon;
|
iconfile = Icon;
|
||||||
|
|
||||||
//handle select values
|
//handle select values
|
||||||
widget_index = w_index;
|
if(w_index > MN_WIDGET_ID_MAX){
|
||||||
|
//error
|
||||||
|
fprintf(stderr, "Warning: %s Index ID value (%i) is bigger than MN_WIDGET_ID_MAX (%i) \n", __FUNCTION__,w_index,MN_WIDGET_ID_MAX );
|
||||||
|
widget_index = NO_WIDGET_ID;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
//ok
|
||||||
|
widget_index = w_index;
|
||||||
|
}
|
||||||
preselected = NO_WIDGET_ID;
|
preselected = NO_WIDGET_ID;
|
||||||
selected = (widget_index == NO_WIDGET_ID ? preselected : mglobal->v_selected[widget_index]);
|
selected = (widget_index == NO_WIDGET_ID ? preselected : mglobal->v_selected[widget_index]);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user