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:
Alexander G. M. Smith
2015-06-01 18:26:47 -04:00
committed by Augustin Cavalier
parent 6a7370ae68
commit 88f9012805
+1 -1
View File
@@ -1456,7 +1456,7 @@ BMessage::SetCurrentSpecifier(int32 index)
if (result != B_OK)
return result;
if (index > count)
if (index >= count)
return B_BAD_INDEX;
fHeader->current_specifier = index;