>From b41dfec16ca0926d6b64e9856552c716f08dde50 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Mon, 29 Feb 2016 11:56:05 +1300 Subject: [PATCH] Check if port is open before file-lock operations The file-lock functions in posixunix.scm didn't check if the port was actually open. Calling fileno on a closed descriptor causes a invalid memory read, as pointed out by valgrind. Signed-off-by: Evan Hanson --- posixunix.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posixunix.scm b/posixunix.scm index 2e9b9cd..f56960d 100644 --- a/posixunix.scm +++ b/posixunix.scm @@ -1351,7 +1351,7 @@ EOF (define (setup port args loc) (let-optionals* args ([start 0] [len #t] ) - (##sys#check-port port loc) + (##sys#check-open-port port loc) (##sys#check-number start loc) (if (eq? #t len) (set! len 0) -- 2.7.0.rc3