diff options
-rw-r--r-- | Changes | 1 | ||||
-rw-r--r-- | byterun/startup.c | 3 |
2 files changed, 3 insertions, 1 deletions
@@ -96,6 +96,7 @@ Bug fixes: - PR#5327: (Windows) Unix.select blocks if same socket listed in first and third arguments - PR#5343: ocaml -rectypes is unsound wrt module subtyping (was still unsound) +- PR#5350: missing return code checks in the runtime system - PR#5468: ocamlbuild should preserve order of parametric tags - PR#5547: Enable the "-use-ocamlfind" option by default - PR#5551: Avoid repeated lookups for missing cmi files diff --git a/byterun/startup.c b/byterun/startup.c index 11b18db69..923723f8d 100644 --- a/byterun/startup.c +++ b/byterun/startup.c @@ -88,7 +88,8 @@ static void fixup_endianness_trailer(uint32 * p) static int read_trailer(int fd, struct exec_trailer *trail) { - lseek(fd, (long) -TRAILER_SIZE, SEEK_END); + if (lseek(fd, (long) -TRAILER_SIZE, SEEK_END) == -1) + return BAD_BYTECODE; if (read(fd, (char *) trail, TRAILER_SIZE) < TRAILER_SIZE) return BAD_BYTECODE; fixup_endianness_trailer(&trail->num_sections); |