summaryrefslogtreecommitdiffstats
path: root/byterun/startup.c
diff options
context:
space:
mode:
Diffstat (limited to 'byterun/startup.c')
-rw-r--r--byterun/startup.c3
1 files changed, 2 insertions, 1 deletions
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);