From: Kevin Day Date: Wed, 11 May 2022 03:08:59 +0000 (-0500) Subject: Bugfix: Invalid read in f_file_stream_read_until(). X-Git-Tag: 0.5.10~155 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=33f942a68253870a6601758fad915705aeb98b9d;p=fll 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. --- 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);