]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: fix mpls_str2label()
authorQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 5 Jul 2017 16:56:52 +0000 (12:56 -0400)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 5 Jul 2017 16:56:52 +0000 (12:56 -0400)
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>
zebra/zebra_mpls.c

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