ports/77488: devel/p5-String-Ediff seg faults
Anton Berezin
tobez at tobez.org
Mon Feb 14 10:40:10 UTC 2005
The following reply was made to PR ports/77488; it has been noted by GNATS.
From: Anton Berezin <tobez at tobez.org>
To: Jonathan Noack <noackjr at alumni.rice.edu>
Cc: FreeBSD-gnats-submit at FreeBSD.org, knu at FreeBSD.org,
boxzou at yahoo.com
Subject: Re: ports/77488: devel/p5-String-Ediff seg faults
Date: Mon, 14 Feb 2005 11:38:13 +0100
On Mon, Feb 14, 2005 at 03:54:44AM -0600, Jonathan Noack wrote:
> While tracking down a problem with devel/cvsweb3, I discovered the
> issue was really that ediff was seg faulting. The attached test.pl
> simulates a call to ediff in cvsweb that failed (this is merely one
> example; I can provide many). I tested this on two different machines
> with identical results. Please let me know if I can provide further
> info.
> #0 ediff (s1=0x8054ba8 " * $Id$", s2=0x80680a8 " * $Header$") at st.c:747
> 747 ret[0] = 0;
> (gdb) l 747
> 742 ix++;
> 743 tmp_seg = tmp_seg->m_next;
> 744 }
> 745 #define INT_LEN 11
> 746 ret = (char*)malloc(sizeof(char) * INT_LEN * ix * 8);
> 747 ret[0] = 0;
> 748 tmp_seg = equals;
> 749 while (tmp_seg) {
> 750 char buff[4 * INT_LEN + 1];
> 751 if (tmp_seg->m_begin_line_num1 < 0) {
This clearly happens because ix is 0, which happens when equals is NULL.
There is no protection for this condition in the code. It is probably
better to contact the module author, boxzou at yahoo dot com, directly
(CCed).
>>How-To-Repeat:
> Run attached test.pl
>>Fix:
> *shrug*
>--- test.pl begins here ---
>#!/usr/bin/perl -wT
>
>require String::Ediff;
>
>my $left_diff = " * \$Id\$";
>my $right_diff = " * \$Header\$";
>my $diff_str = String::Ediff::ediff($left_diff, $right_diff);
>
>printf "diff_str = $diff_str";
>--- test.pl ends here ---
\Anton.
--
The moronity of the universe is a monotonically increasing function. --
Jarkko Hietaniemi
More information about the freebsd-ports-bugs
mailing list