user/5077: OpenCVS cannot "checkout" local repositories

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

user/5077: OpenCVS cannot "checkout" local repositories

ttakah
>Number:         5077
>Category:       user
>Synopsis:       OpenCVS cannot "checkout" local repositories
>Confidential:   yes
>Severity:       non-critical
>Priority:       low
>Responsible:    bugs
>State:          open
>Quarter:        
>Keywords:      
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Apr 15 03:30:02 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     TAKAHASHI Tamotsu
>Release:        Apr 14 2006
>Organization:
net
>Environment:
        System      : OpenBSD 3.9
        Architecture: OpenBSD.i386
        Machine     : i386
>Description:
"cvs co local_repo" will fail with segmentation fault
due to strlcpy(buf, NULL, len).
The failing point is around the 776th line of util.c.

>How-To-Repeat:
- create a local repository.
 (cvs init; cd repo; cvs import repo vendor release)
- checkout it.
 (cd emptydir; cvs checkout repo)
- segv.

>Fix:
A workaround is here, but I am not sure this is correct.

Index: util.c
===================================================================
RCS file: /cvs/src/usr.bin/cvs/util.c,v
retrieving revision 1.78
diff -p -u -r1.78 util.c
--- util.c 14 Apr 2006 02:45:35 -0000 1.78
+++ util.c 14 Apr 2006 23:43:41 -0000
@@ -769,7 +769,8 @@ cvs_rcs_getpath(CVSFILE *file, char *buf
  struct cvsroot *root;
 
  root = CVS_DIR_ROOT(file);
- repo = CVS_DIR_REPO(file);
+ repo = CVS_DIR_REPO(file) ? CVS_DIR_REPO(file) :
+ file->cf_parent ? file->cf_dir : "";
 
  if (strlcpy(buf, root->cr_dir, len) >= len ||
     strlcat(buf, "/", len) >= len ||


>Release-Note:
>Audit-Trail:
>Unformatted: