Mercurial > hg > xemacs-beta
changeset 5839:d139eb1fead8
Check return value of fseek.
author | Marcus Crestani <marcus@crestani.de> |
---|---|
date | Sat, 13 Dec 2014 14:09:33 +0100 |
parents | b1500f1ec617 |
children | 93a18dbcfd8c |
files | src/ChangeLog src/dumper.c |
diffstat | 2 files changed, 17 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog Sat Dec 13 14:02:55 2014 +0100 +++ b/src/ChangeLog Sat Dec 13 14:09:33 2014 +0100 @@ -1,3 +1,8 @@ +2014-12-13 Marcus Crestani <crestani@xemacs.org> + + * dumper.c (pdump_align_stream): + * dumper.c (pdump): Check return value of fseek. + 2014-12-13 Marcus Crestani <crestani@xemacs.org> * dumper.c (pdump_file_get): Check return value of lseek.
--- a/src/dumper.c Sat Dec 13 14:02:55 2014 +0100 +++ b/src/dumper.c Sat Dec 13 14:09:33 2014 +0100 @@ -206,7 +206,13 @@ OFF_T offset = FTELL (stream); OFF_T adjustment = ALIGN_SIZE (offset, alignment) - offset; if (adjustment) - FSEEK (stream, adjustment, SEEK_CUR); + { + if (FSEEK (stream, adjustment, SEEK_CUR) == -1) + { + report_file_error ("Unable to fseek dump file", + build_ascstring (EMACS_PROGNAME ".dmp")); + } + } } #define PDUMP_ALIGN_OUTPUT(type) pdump_align_stream (pdump_out, ALIGNOF (type)) @@ -2168,7 +2174,11 @@ elt->fcts->convert_free(elt->object, elt->data, elt->size); } - FSEEK (pdump_out, header.stab_offset, SEEK_SET); + if (FSEEK (pdump_out, header.stab_offset, SEEK_SET) == -1) + { + report_file_error ("Unable to fseek dump file", + build_ascstring (EMACS_PROGNAME ".dmp")); + } #ifdef NEW_GC {