Ftpc: fix for bugs with buffers 'remote_list_buf' and 'buf_buffer2'
All checks were successful
Build system / Check kernel codestyle (pull_request) Successful in 1m16s
Build system / Build (pull_request) Successful in 8m58s

This commit is contained in:
2025-04-07 21:25:52 +03:00
parent 70b05aaa86
commit 148a3292fb
2 changed files with 7 additions and 7 deletions

View File

@@ -105,7 +105,6 @@ console: ;//////////////////////////////////////////////////////////////////////
mov eax, [esp+36] mov eax, [esp+36]
call write_to_file call write_to_file
@@:
popad popad
ret 4 ret 4

View File

@@ -372,7 +372,6 @@ gui: ;//////////////////////////////////////////////////////////////////////////
sub ecx, 2 ; 0a0d is not included sub ecx, 2 ; 0a0d is not included
call write_to_file call write_to_file
@@:
popad popad
ret 4 ret 4
@@ -392,13 +391,16 @@ gui: ;//////////////////////////////////////////////////////////////////////////
;< none ;; ;< none ;;
;;================================================================================================;; ;;================================================================================================;;
push edx cmp eax, 1
push eax jl data_loop
push edx eax
; check if any incomplete entry to be parsed ; check if any incomplete entry to be parsed
cmp byte[remote_list_buf], 0 cmp byte[remote_list_buf], 0
je .no_backlog je .no_backlog
; find end of remote_list_buf ; find end of remote_list_buf
mov edi, remote_list_buf mov edi, remote_list_buf
mov ecx, 1024 ;buffer size
mov al, 0 mov al, 0
repne scasb repne scasb
; copy rest of the incomplete entry to remote_list_buf ; copy rest of the incomplete entry to remote_list_buf
@@ -494,9 +496,9 @@ gui: ;//////////////////////////////////////////////////////////////////////////
.store_last_entry: .store_last_entry:
; find index of the last incomplete entry ; find index of the last incomplete entry
mov ecx, -1
mov eax, [esp] mov eax, [esp]
lea edi, [buf_buffer2+eax-2] lea edi, [buf_buffer2+eax-2]
mov ecx, eax
mov al, 0x0a mov al, 0x0a
std std
repne scasb repne scasb
@@ -514,8 +516,7 @@ gui: ;//////////////////////////////////////////////////////////////////////////
stdcall [tl_cur_beg], tree2 stdcall [tl_cur_beg], tree2
or dword[tree2.style], 8 or dword[tree2.style], 8
call .draw ; to update tree list immediately in case of "auto_list" call .draw ; to update tree list immediately in case of "auto_list"
pop eax pop eax edx
pop edx
jmp data_loop jmp data_loop
; clear tree list and add ".." node before executing "LIST" ; clear tree list and add ".." node before executing "LIST"