mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #1501 from iij/pr_fix_read_debug_section
Fix checking return value of fread()
This commit is contained in:
+1
-1
@@ -734,7 +734,7 @@ mrb_read_irep_file(mrb_state *mrb, FILE* fp)
|
||||
else if (memcmp(section_header.section_identify, RITE_SECTION_DEBUG_IDENTIFIER, sizeof(section_header.section_identify)) == 0) {
|
||||
uint8_t* const bin = mrb_malloc(mrb, section_size);
|
||||
fseek(fp, fpos, SEEK_SET);
|
||||
if(fread((char*)bin, section_size, 1, fp) != section_size) {
|
||||
if(fread((char*)bin, section_size, 1, fp) != 1) {
|
||||
mrb_free(mrb, bin);
|
||||
return MRB_DUMP_READ_FAULT;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user