# HG changeset patch # User Marcus Crestani # Date 1418476173 -3600 # Node ID d139eb1fead83d1869b510473d6a9f7e2ae5f2d0 # Parent b1500f1ec617d0e469c77dd29b6c57d00f9505ef Check return value of fseek. diff -r b1500f1ec617 -r d139eb1fead8 src/ChangeLog --- 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 + + * dumper.c (pdump_align_stream): + * dumper.c (pdump): Check return value of fseek. + 2014-12-13 Marcus Crestani * dumper.c (pdump_file_get): Check return value of lseek. diff -r b1500f1ec617 -r d139eb1fead8 src/dumper.c --- 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 {