Date: Mon, 14 Feb 2005 10:40:09 GMT From: Anton Berezin <tobez@tobez.org> To: freebsd-ports-bugs@FreeBSD.org Subject: Re: ports/77488: devel/p5-String-Ediff seg faults Message-ID: <200502141040.j1EAe9Qn013249@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/77488; it has been noted by GNATS. From: Anton Berezin <tobez@tobez.org> To: Jonathan Noack <noackjr@alumni.rice.edu> Cc: FreeBSD-gnats-submit@FreeBSD.org, knu@FreeBSD.org, boxzou@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200502141040.j1EAe9Qn013249>