UINT_MAX - 1 and little_len to UINT_MAX - 2? Still safe? Not. If you're supporting API or functionality to users, you have to give flexibility to them but not too much.
Did you try out UINT_Max?
No need to try, you're not checking that memory boundaries in your function call, you're expecting that string and string length has to be matched.
Also, there is no NULL checking for strings in the function. So. not safe for usage, open for overflow problems.
This my moby stack size! int main(void) { char string[1024*510] = "stack size"; } Beyond is stack overflow; program run fine!!
Checkout their stack size higher than mine! I haven’t tested online! You may test.
This checks NULL beyond string! Mapping is on elements.
that doesn't do what you think
start[curr_pos] Is Better than *(start+curr_pos)
On the for you have buffer overflow in start[curr_pos+i]
it's literally the same
Обсуждают сегодня