zebra: fix mpls_str2label()

When making improvements to error handling in this code I accidentally
introduced an off-by-one. Fix it.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
Quentin Young 2017-07-05 12:56:52 -04:00
parent c6200b5467
commit a79d6ebb48
No known key found for this signature in database
GPG Key ID: DAF48E0F57E0834F

View File

@ -1774,7 +1774,7 @@ mpls_str2label (const char *label_str, u_int8_t *num_labels,
if (!rc) if (!rc)
{ {
*num_labels = i + 1; *num_labels = i;
memcpy (labels, pl, *num_labels * sizeof (mpls_label_t)); memcpy (labels, pl, *num_labels * sizeof (mpls_label_t));
} }