Fix buffer overrun in kprintf

This commit is contained in:
Victor Timofei 2022-05-03 23:01:43 +03:00
parent 31edb70092
commit 342b317558
Signed by: vtimofei
GPG Key ID: B790DCEBE281403A
1 changed files with 3 additions and 1 deletions

View File

@ -133,8 +133,10 @@ void kprintf(char *format, ...)
for (int idx = 0; format[idx] != '\0'; idx++) {
while (format[idx] != '%') {
/* Never overrun the buffer */
if (format[idx] == '\0')
break;
return;
console_puts(format[idx]);
idx++;