Re: cvsimport fails with cvsps core dump

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/12/06, Rajkumar S <rajkumars+git@xxxxxxxxx> 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
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]