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

Bug#649487: detex: segfault with argument "--version"



On 21.11.11 Matthew Wakeling (matthew@wakeling.homeip.net) wrote:
> On Mon, 21 Nov 2011, Hilmar Preusse wrote:

Hi,

> >Recompiling the texlive-binaries package does not solve the problem.
> >Then I download the detex package from
> >http://www.cs.purdue.edu/homes/trinkle/detex/ (it is not on CTAN
> >AFAICT), but failed to compile it
> >
> >hille@sid:~/detex-2.8 $ make
> >sed -f states.sed detex.l > xxx.l
> >lex  xxx.l
> >rm -f xxx.l
> >mv lex.yy.c detex.c
> >cc -O    -c -o detex.o detex.c
> >xxx.l:77:7: error: conflicting types for ?malloc?
> 
> The latest version downloaded from source does not have this bug.
> What version is in texlive-binaries?
> 
It is always the version from CTAN, i.e. 2.7. As 2.8 hasn't been
uploaded to CTAN it will not appear in TeX Live. Are you willing to
contact the detex author and tell him to upload to CTAN?

> To get the compile to work, remove the line "char    *malloc();"
> from detex.l. The return type char* conflicts with the Linux malloc
> return type of void*.
> 
After replacing that "char    *malloc();" by

#ifdef __linux__
void<-->*malloc();
#else
char<-->*malloc();
#endif

I can compile it too.

Regarding the original problem. In detex 2.7 it simply tries to
process the arguments w/o checking it.  This has been improved in
detex 2.8. I put the necessary change into the attached patch (incl.
the typo ;-)). Norbert do you think it is worth to do an upload for
this or put it into TL 2011?

H.
-- 
sigmentation fault
--- detex.l.orig	1999-05-12 17:45:00.000000000 +0200
+++ detex.l	2011-11-22 10:50:49.000000000 +0100
@@ -270,7 +270,10 @@
 			fCite = 1;
 			break;
 		    case CHENVOPT:
-			sbEnvList = rgsbArgs[++iArgs];
+			if (++iArgs >= cArgs) {
+			ErrorExit("-e option requires and argument");
+			}
+			sbEnvList = rgsbArgs[iArgs];
 			break;
 		    case CHLATEXOPT:
 			fLatex = 1;

Attachment: signature.asc
Description: Digital signature


Reply to: