> specified bound depends on the length of the source argument
[-Wstringop-truncation]
I believe the strncpy warning can be ignored because the buffer was
reallocated using that size just before:
static void str_append(char **buf, const char *repr)
{
if (*buf) {
*buf = realloc(*buf, strlen(*buf) + strlen(repr) + 1);
assert(*buf);
strncpy((*buf) + strlen(*buf), repr, strlen(repr) + 1);
} else {
*buf = strdup(repr);
assert(*buf);
}
}
And we are copying into the middle of the reallocated buffer, not its start.
Furthermore, this is test code.
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1951834
Title:
[MIR]: frr
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/frr/+bug/1951834/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs