From 67ef543bae5f4f588bb1ed7cd831e6870cf33ca3 Mon Sep 17 00:00:00 2001 From: Bart Oldeman Date: Mon, 1 Sep 2003 17:49:40 +0000 Subject: [PATCH] Fix pointer overflow problem for reading line using handle. git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@671 6ac86273-5f31-0410-b378-82cca8765d1b --- kernel/chario.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/chario.c b/kernel/chario.c index 5082768..0e369bf 100644 --- a/kernel/chario.c +++ b/kernel/chario.c @@ -534,7 +534,7 @@ size_t read_line_handle(int sft_idx, size_t n, char FAR * bp) } } - if (inputptr > bufend - n) + if (n > bufend - inputptr) n = bufend - inputptr; fmemcpy(bp, inputptr, n);