~ chicken-core (chicken-5) 3cafafd5f1d65280c56f15e50f9d266c6eb06cb0


commit 3cafafd5f1d65280c56f15e50f9d266c6eb06cb0
Author:     Evan Hanson <evhan@foldling.org>
AuthorDate: Mon Nov 6 17:43:29 2017 +1300
Commit:     Peter Bex <peter@more-magic.net>
CommitDate: Sat Nov 11 15:59:59 2017 +0100

    Drop `read-string' rewrite from c-platform.scm
    
    After 25064a3c, the c-platform rewrite for `read-string' would ignore
    its second argument and use an internal version of the procedure
    whenever at least one argument was given, leading to potentially unsafe
    behaviour since the type of that second argument wouldn't be checked (it
    must be an *open* input port).
    
    To fix this, we simply remove the rewrite so the port argument is always
    checked at runtime.
    
    Signed-off-by: Peter Bex <peter@more-magic.net>

diff --git a/c-platform.scm b/c-platform.scm
index d2323fe8..523ad20f 100644
--- a/c-platform.scm
+++ b/c-platform.scm
@@ -1053,7 +1053,6 @@
 
 (rewrite 'scheme#read-char 23 0 '##sys#read-char/port '##sys#standard-input)
 (rewrite 'scheme#write-char 23 1 '##sys#write-char/port '##sys#standard-output)
-(rewrite 'chicken.io#read-string 23 1 'chicken.io#read-string/port '##sys#standard-input)
 (rewrite 'chicken.string#substring=? 23 2 '##sys#substring=? 0 0 #f)
 (rewrite 'chicken.string#substring-ci=? 23 2 '##sys#substring-ci=? 0 0 #f)
 (rewrite 'chicken.string#substring-index 23 2 '##sys#substring-index 0)
Trap