CID 4383 and 4384: Fix wrong checks of index values against kMaxWorkspaces that
could otherwise lead to out of bound access. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39933 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -610,7 +610,7 @@ DesktopSettingsPrivate::WorkspacesRows() const
|
||||
void
|
||||
DesktopSettingsPrivate::SetWorkspacesMessage(int32 index, BMessage& message)
|
||||
{
|
||||
if (index < 0 || index > kMaxWorkspaces)
|
||||
if (index < 0 || index >= kMaxWorkspaces)
|
||||
return;
|
||||
|
||||
fWorkspaceMessages[index] = message;
|
||||
@@ -620,7 +620,7 @@ DesktopSettingsPrivate::SetWorkspacesMessage(int32 index, BMessage& message)
|
||||
const BMessage*
|
||||
DesktopSettingsPrivate::WorkspacesMessage(int32 index) const
|
||||
{
|
||||
if (index < 0 || index > kMaxWorkspaces)
|
||||
if (index < 0 || index >= kMaxWorkspaces)
|
||||
return NULL;
|
||||
|
||||
return &fWorkspaceMessages[index];
|
||||
|
||||
Reference in New Issue
Block a user