From eac9754a4d47ad632fa2fd98d79909a359524765 Mon Sep 17 00:00:00 2001 From: antifallobst Date: Fri, 24 Feb 2023 01:00:06 +0100 Subject: [PATCH] fix (kernel): fixed a potential string overflow in 'string_find_next' --- kernel/src/utils/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/src/utils/string.c b/kernel/src/utils/string.c index 3a0a113..96cac0a 100644 --- a/kernel/src/utils/string.c +++ b/kernel/src/utils/string.c @@ -35,7 +35,7 @@ bool string_compare(string_t a, string_t b) { uint32_t string_find_next(string_t string, char chr) { uint32_t n = 0; - while(*string != chr) { + while(*string != chr && *string != '\0') { string++; n++; }