From f28885f4957882c4d96bdfee11d26cd265539aac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 25 Mar 2013 13:28:42 +0100 Subject: [PATCH] sendfile: Check return value of `lseek'. * libguile/filesys.c (scm_sendfile): Check return value of `lseek_or_lseek64', and use `SCM_SYSERROR' upon error. --- libguile/filesys.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libguile/filesys.c b/libguile/filesys.c index 6804db9fb..334e2cd07 100644 --- a/libguile/filesys.c +++ b/libguile/filesys.c @@ -1157,7 +1157,10 @@ SCM_DEFINE (scm_sendfile, "sendfile", 3, 1, 0, if (SCM_PORTP (in)) scm_seek (in, offset, scm_from_int (SEEK_SET)); else - lseek_or_lseek64 (in_fd, c_offset, SEEK_SET); + { + if (lseek_or_lseek64 (in_fd, c_offset, SEEK_SET) < 0) + SCM_SYSERROR; + } } for (result = 0, left = c_count; result < c_count; )