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

Bug#2335: Man get segmentation fault



Package: man
Version: 2.3.10-8

[If this was already reported please ignore this mail. I can't check that at
the moment over my PPP connection.]

Man dumps core sometimes at least as ELF binary.

I just got the following from H.J. Lu. I thought there was a bug in the
latest libc release, because man dumps core because of a corrupted variable
after a libc call.

H J Lu writes:
> I have sent this patch almost two months ago. Why is the bug still
> there?
>
> diff -rc -x CVS man-2.3.10/src/catman.c man-2.3.10.fixed/src/catman.c
> *** man-2.3.10/src/catman.c	Wed Sep 20 11:31:58 1995
> --- man-2.3.10.fixed/src/catman.c	Sat Dec 23 09:54:52 1995
> ***************
> *** 387,392 ****
> --- 387,396 ----
>
>   #ifdef HAVE_SETLOCALE
>   	locale = NLS_INIT;
> + 	if (locale)
> + 	{
> + 		locale = xstrdup (locale);
> + 	}
>   #endif /* HAVE_SETLOCALE */
>
>   	while ((c = getopt_long (argc, argv, args,
> diff -rc -x CVS man-2.3.10/src/man.c man-2.3.10.fixed/src/man.c
> *** man-2.3.10/src/man.c	Wed Sep 20 11:31:58 1995
> --- man-2.3.10.fixed/src/man.c	Sat Dec 23 09:50:06 1995
> ***************
> *** 675,680 ****
> --- 675,684 ----
>   	/* initialise the locale */
>   #ifdef HAVE_SETLOCALE
>   	internal_locale = NLS_INIT;
> + 	if (internal_locale)
> + 	{
> + 		internal_locale = xstrdup (internal_locale);
> + 	}
>   #endif /* HAVE_SETLOCALE */
>
>   /* export argv, it might be needed when invoking the vendor supplied browser */
> ***************
> *** 730,735 ****
> --- 734,743 ----
>   	   issued as an argument or in $MANOPT */
>   	if (locale) {
>   		internal_locale = setlocale(LC_MESSAGES, locale);
> + 		if (internal_locale)
> + 		{
> + 			internal_locale = xstrdup (internal_locale);
> + 		}
>   #  ifdef NLS
>   		NLS_CLOSE;
>   		catfd = catopen("man_db", MCLoadBySet);
> diff -rc -x CVS man-2.3.10/src/whatis.c man-2.3.10.fixed/src/whatis.c
> *** man-2.3.10/src/whatis.c	Wed Sep 20 11:31:59 1995
> --- man-2.3.10.fixed/src/whatis.c	Sat Dec 23 09:54:39 1995
> ***************
> *** 497,502 ****
> --- 497,506 ----
>
>   #ifdef HAVE_SETLOCALE
>   	locale = NLS_INIT;
> + 	if (locale)
> + 	{
> + 		locale = xstrdup (locale);
> + 	}
>   #endif /* HAVE_SETLOCALE */
>
>   	while ((c = getopt_long (argc, argv, args,

Michael

--
Michael Meskes
Lehrstuhl fuer angewandte Mathematik insb. Informatik
RWTH-Aachen, D-52056 Aachen, Germany
email: meskes@informatik.rwth-aachen.de


Reply to: