Re: cvsimport fails with cvsps core dump
- From
- Rajkumar S <rajkumars+git@gmail.com>
- Date
- Sep 14, 2006, 07:22 UTC
- Message-ID
- <64de5c8b0609140022q1b645416kfcc4012145fb5085@mail.gmail.com>
- In-Reply-To
- <64de5c8b0609120914p4ea47860x60a294093d43bc24@mail.gmail.com>
On 9/12/06, Rajkumar S <rajkumars+git@gmail.com> wrote:
> While trying to cvsimport pfsense [1] source [2], cvsps coredumps and > cvsimport aborts with the following error.
the function read_line does not check if the string is bigger that the space alloted, and core dumps when such a string is encountered.
I have a small patch which prevents the crashing, by stopping the copy when the buffer is full.
diff --git a/cvs_direct.c b/cvs_direct.c index 920487d..3857ce2 100644 --- a/cvs_direct.c +++ b/cvs_direct.c @@ -679,8 +679,11 @@ static int read_line(CvsServerCtx * ctx, } p++; len++; + if (len >= BUFSIZ){ + *p = 0; + break; + } } - return len; } raj