BMessage: fix an off-by-one error in SetCurrentSpecifier.
You could set the index to be past the end of the Specifier array. Signed-off-by: Augustin Cavalier <[email protected]> Fixes #12087.
This commit is contained in:
committed by
Augustin Cavalier
parent
6a7370ae68
commit
88f9012805
@@ -1456,7 +1456,7 @@ BMessage::SetCurrentSpecifier(int32 index)
|
|||||||
if (result != B_OK)
|
if (result != B_OK)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
if (index > count)
|
if (index >= count)
|
||||||
return B_BAD_INDEX;
|
return B_BAD_INDEX;
|
||||||
|
|
||||||
fHeader->current_specifier = index;
|
fHeader->current_specifier = index;
|
||||||
|
|||||||
Reference in New Issue
Block a user