]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: Allow ZAPI_MESSAGE_OPAQUE_LENGTH length of data 9003/head
authorDonald Sharp <sharpd@nvidia.com>
Wed, 7 Jul 2021 20:00:12 +0000 (16:00 -0400)
committermergify-bot <noreply@mergify.io>
Thu, 8 Jul 2021 01:36:12 +0000 (01:36 +0000)
We are sending up to ZAPI_MESSAGE_OPAQUE_LENGTH but checking
for one less.  We know the data will fit in it to that size.
Also we have asserts on the write to ensure we don't go over
it

Fixes: #8995
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 3b1849be3211bdc7c53bdeb0d982863dfe0284d0)

lib/zclient.c

index 365635a8da88f1e62a24f4c923e6e288381a0315..bf4966a5d7776d98a0af4122f2dd299a858086b9 100644 (file)
@@ -1418,7 +1418,7 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api)
 
        if (CHECK_FLAG(api->message, ZAPI_MESSAGE_OPAQUE)) {
                STREAM_GETW(s, api->opaque.length);
-               assert(api->opaque.length < ZAPI_MESSAGE_OPAQUE_LENGTH);
+               assert(api->opaque.length <= ZAPI_MESSAGE_OPAQUE_LENGTH);
 
                STREAM_GET(api->opaque.data, s, api->opaque.length);
        }