From 33f942a68253870a6601758fad915705aeb98b9d Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Tue, 10 May 2022 22:08:59 -0500 Subject: [PATCH] Bugfix: Invalid read in f_file_stream_read_until(). The file.size_read variable is incorrectly being used when instead the buffer_size variable is intended to be used. --- level_0/f_file/c/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/level_0/f_file/c/file.c b/level_0/f_file/c/file.c index 0fcb4fa..51e8755 100644 --- a/level_0/f_file/c/file.c +++ b/level_0/f_file/c/file.c @@ -2349,7 +2349,7 @@ extern "C" { buffer_size = total - buffer_count; } - size_read = fread_unlocked(buffer->string + buffer->used, sizeof(f_char_t), file.size_read, file.stream); + size_read = fread_unlocked(buffer->string + buffer->used, sizeof(f_char_t), buffer_size, file.stream); if (ferror_unlocked(file.stream)) { funlockfile(file.stream); -- 1.8.3.1