]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: Allow ZAPI_MESSAGE_OPAQUE_LENGTH length of data
authorDonald Sharp <sharpd@nvidia.com>
Wed, 7 Jul 2021 20:00:12 +0000 (16:00 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Wed, 7 Jul 2021 20:01:32 +0000 (16:01 -0400)
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>
lib/zclient.c

index dc832276590d599cc65cc31a3e6bd91cdfa7a5c5..0815e77d4edff76b9f8712531c5be807e0340918 100644 (file)
@@ -1537,7 +1537,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);
        }