Coverity says:
Error: BUFFER_SIZE_WARNING (CWE-120): [#def1]
libnl-3.4.0/lib/route/cls/ematch/text.c:94: buffer_size_warning: Calling strncpy with a maximum size argument of 16 bytes on destination array "t->cfg.algo" of size 16 bytes might leave the destination string unterminated.
# 92| struct text_data *t = rtnl_ematch_data(e);
# 93|
# 94|-> strncpy(t->cfg.algo, algo, sizeof(t->cfg.algo));
# 95| }
# 96|
Error: BUFFER_SIZE_WARNING (CWE-120): [#def11]
libnl-3.4.0/lib/xfrm/sa.c:1192: buffer_size_warning: Calling strncpy with a maximum size argument of 64 bytes on destination array "auth->alg_name" of size 64 bytes might leave the destination string unterminated.
# 1190| }
# 1191|
# 1192|-> strncpy(auth->alg_name, tmpl->auth->alg_name, sizeof(auth->alg_name));
# 1193| auth->alg_key_len = tmpl->auth->alg_key_len;
# 1194| memcpy(auth->alg_key, tmpl->auth->alg_key, (tmpl->auth->alg_key_len + 7) / 8);
struct text_data *t = rtnl_ematch_data(e);
strncpy(t->cfg.algo, algo, sizeof(t->cfg.algo));
+ t->cfg.algo[sizeof(t->cfg.algo) - 1] = '\0';
}
char *rtnl_ematch_text_get_algo(struct rtnl_ematch *e)
}
strncpy(auth->alg_name, tmpl->auth->alg_name, sizeof(auth->alg_name));
+ auth->alg_name[sizeof(auth->alg_name) - 1] = '\0';
auth->alg_key_len = tmpl->auth->alg_key_len;
memcpy(auth->alg_key, tmpl->auth->alg_key, (tmpl->auth->alg_key_len + 7) / 8);
if (nla_put(msg, XFRMA_ALG_AUTH, len, auth) < 0) {