mirror of
https://github.com/limine-bootloader/limine
synced 2024-12-02 21:26:59 +03:00
stivale2: Prevent buffer overflows when writing to stivale2 terminal
This commit is contained in:
parent
d85e6302db
commit
ffac9b1c68
@ -8,8 +8,10 @@ user_ds: resq 1
|
||||
user_es: resq 1
|
||||
user_ss: resq 1
|
||||
|
||||
%define MAX_TERM_BUF 1024
|
||||
|
||||
term_buf:
|
||||
resb 1024
|
||||
resb MAX_TERM_BUF
|
||||
|
||||
section .text
|
||||
|
||||
@ -35,6 +37,9 @@ stivale2_term_write_entry:
|
||||
|
||||
push rsi
|
||||
mov rcx, rsi
|
||||
mov rax, MAX_TERM_BUF
|
||||
cmp rcx, rax
|
||||
cmovg rcx, rax
|
||||
mov rsi, rdi
|
||||
mov edi, term_buf
|
||||
rep movsb
|
||||
|
Loading…
Reference in New Issue
Block a user