-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
it's possible to invade stack data without error message.
Steps to reproduce
In task5.cpp:
for(i = 0; i < 6; i++)
{
stack_push(&stk, i + 10);
}
stk.data[5] = 0xAB0BA;
for(; i < 20; i++)
{
stack_push(&stk, i + 10);
}Expected Behaviour
An error was expected after changing the value of stk.data[5].
Current Behaviour
stack_is_invalid() doesn't detect changes.
Possible solution
oat_hash(stk->data, (size_t) stk->capacity) doesn't fully hash the data. Expected function call:
oat_hash(stk->data, (size_t) stk->capacity * sizeof(elem_t));Version: commit 5d29b89
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels