~ chicken-core (chicken-5) 66bcec0b24a004fa974a5d604a4ea04f653009e0
commit 66bcec0b24a004fa974a5d604a4ea04f653009e0 Author: LemonBoy <thatlemon@gmail.com> AuthorDate: Sun Feb 28 20:34:56 2016 +0100 Commit: Peter Bex <peter@more-magic.net> CommitDate: Mon Feb 29 22:34:53 2016 +0100 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 <evhan@foldling.org> Signed-off-by: Peter Bex <peter@more-magic.net> diff --git a/posixunix.scm b/posixunix.scm index 7ad7e3d0..899ead6a 100644 --- a/posixunix.scm +++ b/posixunix.scm @@ -1414,7 +1414,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-exact-integer start loc) (if (eq? #t len) (set! len 0)Trap