Unverified Commit 89ca0fc6 authored by jothalha's avatar jothalha Committed by Tobias Ellinghaus

Fix string termination override on memmove. (#1645)

* Fix string termination override on memmove.

strlen returns the number of characters excluding the null
character. When shifting the string, that character has to be
included to avoid undefined behaviour.

* Revert changed comment.

(cherry picked from commit 64916e4e)
parent 32f9188a
......@@ -91,7 +91,7 @@ static int strinc(char *label, size_t buffer_size)
else if(c == label)
{
if(label_len + 1 >= buffer_size) return 0;
memmove(c + 1, c, label_len);
memmove(c + 1, c, label_len + 1);
*c = carry_over;
}
c--;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment