# cvsimport fails with cvsps core dump

2 messages from 2006-09-12 to 2006-09-14. Participants: Rajkumar S.
Thread: https://gitlist.dev/t/5543

## Rajkumar S, 2006-09-12 16:14

Subject: cvsimport fails with cvsps core dump
Message-ID: <64de5c8b0609120914p4ea47860x60a294093d43bc24@mail.gmail.com>
URL: https://gitlist.dev/e/64de5c8b0609120914p4ea47860x60a294093d43bc24%40mail.gmail.com

```
Hi,

While trying to cvsimport pfsense [1] source [2], cvsps coredumps and
cvsimport aborts with the following error.

root@beastie:# git cvsimport -v -d /usr/local/pfSense/tmp/cvsroot -C
pfSense/ pfSense
Running cvsps...
cvs_direct initialized to CVSROOT /usr/local/pfSense/tmp/cvsroot
cvs rlog: Logging pfSense
cvs rlog: Logging pfSense/bin
cvs rlog: Logging pfSense/boot
cvs rlog: Logging pfSense/boot/kernel
cvs rlog: Logging pfSense/cf
cvs rlog: Logging pfSense/cf/conf
cvs rlog: Logging pfSense/conf.default
cvs rlog: Logging pfSense/etc
cvs rlog: Logging pfSense/etc/ascii-art
cvs rlog: Logging pfSense/etc/inc
DONE; creating master branch
fatal: refs/heads/origin: not a valid SHA1
fatal: master: not a valid SHA1
fatal: ambiguous argument 'HEAD': unknown revision or path not in the
working tree.
Use '--' to separate paths from revisions
fatal: Not a valid object name HEAD
checkout failed: 256

root@beastie:# ls pfSense/
.git            cvsps.core

I am trying this in FreeBSD 6.1 with cvsps compiled from master branch
of git repository at http://ydirson.free.fr/soft/git/cvsps.git

To replicate this error get the pfSense cvsroot tarball from [2] and
run the command
$ git cvsimport -v -d /<path>/cvsroot -C pfSense/ pfSense

While this is not a git bug as such, I have written to the cvsps
author about this about one week back with no replies and this seems
to be the only place interested in cvsps.

Thanks and regards,

raj

1 http://www.pfsense.com
2 http://www.pfsense.com/cvs.tgz

```

## Rajkumar S, 2006-09-14 07:22

Subject: Re: cvsimport fails with cvsps core dump
Message-ID: <64de5c8b0609140022q1b645416kfcc4012145fb5085@mail.gmail.com>
URL: https://gitlist.dev/e/64de5c8b0609140022q1b645416kfcc4012145fb5085%40mail.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

```
