From 651fa9cf9d247b102af0e6915544c7ff45cc5adb Mon Sep 17 00:00:00 2001 From: Braiden Vasco Date: Wed, 8 Nov 2017 08:35:08 +0000 Subject: [PATCH] Add const KERNELMQ_INFO_CMDLINE_SLEN_MAX --- arch/multiboot.c | 4 ++-- include/kernelmq/info.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/multiboot.c b/arch/multiboot.c index 921b3f3..842464a 100644 --- a/arch/multiboot.c +++ b/arch/multiboot.c @@ -104,7 +104,7 @@ unsigned char print_multiboot_tag_cmdline(struct KernelMQ_Info *kinfo, const str { unsigned int slen = kstrlen(tag->string); - if (slen >= KERNELMQ_INFO_CMDLINE_SIZE_MAX) { + if (slen > KERNELMQ_INFO_CMDLINE_SLEN_MAX) { return 0; } @@ -121,7 +121,7 @@ unsigned char print_multiboot_tag_module(struct KernelMQ_Info *kinfo, const stru unsigned int cmdline_slen = kstrlen(tag->cmdline); - if (cmdline_slen >= KERNELMQ_INFO_CMDLINE_SIZE_MAX) { + if (cmdline_slen > KERNELMQ_INFO_CMDLINE_SLEN_MAX) { return 0; } diff --git a/include/kernelmq/info.h b/include/kernelmq/info.h index 3cd0c7b..211a364 100644 --- a/include/kernelmq/info.h +++ b/include/kernelmq/info.h @@ -6,6 +6,7 @@ extern "C" { #endif #define KERNELMQ_INFO_CMDLINE_SIZE_MAX 256 +#define KERNELMQ_INFO_CMDLINE_SLEN_MAX (KERNELMQ_INFO_CMDLINE_SIZE_MAX - 1) #define KERNELMQ_INFO_MODULES_MAX 20 #define KERNELMQ_INFO_AREAS_MAX 20