]> git.droids-corp.org - dpdk.git/blobdiff - app/test-pmd/cmdline_flow.c
app/testpmd: add boundary check in flow command
[dpdk.git] / app / test-pmd / cmdline_flow.c
index 5c0108fa702171bb449c7229de0dd678b8884fba..659908fcf1d94cc3a8d1e487564b6860d8d8ec95 100644 (file)
@@ -4327,6 +4327,8 @@ parse_int(struct context *ctx, const struct token *token,
        }
        buf = (uint8_t *)ctx->object + arg->offset;
        size = arg->size;
        }
        buf = (uint8_t *)ctx->object + arg->offset;
        size = arg->size;
+       if (u > RTE_LEN2MASK(size * CHAR_BIT, uint64_t))
+               return -1;
 objmask:
        switch (size) {
        case sizeof(uint8_t):
 objmask:
        switch (size) {
        case sizeof(uint8_t):