]> Kevux Git Server - fll/commitdiff
Bugfix: Invalid read in f_file_stream_read_until().
authorKevin Day <thekevinday@gmail.com>
Wed, 11 May 2022 03:08:59 +0000 (22:08 -0500)
committerKevin Day <thekevinday@gmail.com>
Wed, 11 May 2022 03:08:59 +0000 (22:08 -0500)
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

index 0fcb4fa7534f6e91392d05fde3c8010953a2147d..51e8755ae366bdabe2a957f562657df2870ce76b 100644 (file)
@@ -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);