0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 09:41:54 +00:00

Fix string handling in inputs completing in birdc

Thanks to Martin Mares for notice
This commit is contained in:
Pavel Tvrdík 2015-11-02 16:52:16 +01:00
parent e547061f33
commit 8396fe3654

View File

@ -195,7 +195,7 @@ cmd_find_common_match(struct cmd_node *root, char *cmd, int len, int *pcount, ch
(*pcount)++; (*pcount)++;
if (best < 0) if (best < 0)
{ {
strncpy(buf, m->token + len, BIRDC_INPUT_COMPLETE_BUFFER_LEN); strlcpy(buf, m->token + len, BIRDC_INPUT_COMPLETE_BUFFER_LEN);
best = m->len - len; best = m->len - len;
best_prio = m->prio; best_prio = m->prio;
} }