Date: Wed, 16 Aug 2006 13:08:53 +0900 From: Pyun YongHyeon <pyunyh@gmail.com> To: takawata@jp.freebsd.org Cc: freebsd-current@freebsd.org Subject: Re: AMD64 self build fail during building libmagic Message-ID: <20060816040853.GA45370@cdnetworks.co.kr> In-Reply-To: <200608151633.k7FGX0Ql025447@ns.init-main.com> References: <200608151633.k7FGX0Ql025447@ns.init-main.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--2oS5YaxWCcQjTEyO
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
On Wed, Aug 16, 2006 at 01:33:00AM +0900, takawata@jp.freebsd.org wrote:
> Hi, I recently encountered build failure with libmagic
> for this one month.
> My investigating shows that intermediate executable 'mkmagic'
> fails to detect the termination of some description of entries
> which is longer than expect.(According to contrib/file/file.h
> the length is MAXDESC=64.)
> The following is a workaround for it. Is it known problem?
>
I also encountered the same issue during upgrade to latest CURRENT
on sparc64. mkmagic dumped core on sparc64.
I've mananged to track down the cause of failure and I've sent a
patch to obrien but got no reply yet.
--
Regards,
Pyun YongHyeon
--2oS5YaxWCcQjTEyO
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="apprentice.patch"
Index: apprentice.c
===================================================================
RCS file: /home/ncvs/src/contrib/file/apprentice.c,v
retrieving revision 1.1.1.11
diff -u -r1.1.1.11 apprentice.c
--- apprentice.c 21 Jun 2006 09:28:00 -0000 1.1.1.11
+++ apprentice.c 16 Aug 2006 04:05:26 -0000
@@ -892,8 +892,10 @@
m->nospflag = 1;
} else
m->nospflag = 0;
- while ((m->desc[i++] = *l++) != '\0' && i < MAXDESC)
+ while ((m->desc[i++] = *l++) != '\0' && i < MAXDESC - 1)
/* NULLBODY */;
+ /* make sure to terminate the string */
+ m->desc[i] = '\0';
if (ms->flags & MAGIC_CHECK) {
if (!check_format(ms, m))
--2oS5YaxWCcQjTEyO--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060816040853.GA45370>
