rpms/tetex-lgrind/FC-4 lgrind-3.67-buffersize.patch, NONE, 1.1 lgrind-3.67-options.patch, NONE, 1.1 tetex-lgrind.spec, 1.11, 1.12

Michael Schwendt (mschwendt) fedora-extras-commits at redhat.com
Tue Aug 23 13:56:01 UTC 2005


Author: mschwendt

Update of /cvs/extras/rpms/tetex-lgrind/FC-4
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12719/FC-4

Modified Files:
	tetex-lgrind.spec 
Added Files:
	lgrind-3.67-buffersize.patch lgrind-3.67-options.patch 
Log Message:
* Tue Aug 23 2005 Michael Schwendt <mschwendt[AT]users.sf.net> - 3.67-9
- Fix many segfaults in parsing of options (#166519).
- Fix fgets buffersize in lgutil.c.


lgrind-3.67-buffersize.patch:

--- NEW FILE lgrind-3.67-buffersize.patch ---
diff -Nur lgrind-orig/source/lgutil.c lgrind/source/lgutil.c
--- lgrind-orig/source/lgutil.c	2001-11-04 12:24:22.000000000 +0100
+++ lgrind/source/lgutil.c	2005-08-23 15:03:04.000000000 +0200
@@ -111,9 +111,9 @@
 	*config='\n';
 	do {
 		check=0;
-		if (*config=='\n' || config[strlen(config)-2]!='\\')
+		if (*config=='\n' || (strlen(config)>1 && config[strlen(config)-2]!='\\') )
 			check=1;
-		if (fgets(config, BUFFERSIZE, tf)==NULL) break;
+		if (fgets(config, BUFFERSIZE/4, tf)==NULL) break;
 		if (check!=0) AddToLList(config, &currlch, &llch);
 	} while (strcmp((*currlch).name, "EndOfLanguageDefinitions")!=0);
 	rch=lch;

lgrind-3.67-options.patch:

--- NEW FILE lgrind-3.67-options.patch ---
diff -Nur lgrind-orig/source/lgrind.c lgrind/source/lgrind.c
--- lgrind-orig/source/lgrind.c	2001-11-04 12:24:22.000000000 +0100
+++ lgrind/source/lgrind.c	2005-08-23 14:25:03.000000000 +0200
@@ -327,7 +327,7 @@
 	 }
 
 	 /* put output to non-standard place */
-	 if (!strcmp(argv[0], "-o")) {
+	 if (!strcmp(argv[0], "-o") && argc>1) {
 	    if (freopen(argv[1], "w", stdout) == NULL) {
 		   perror(argv[1]);
 		   return BADEXIT;
@@ -389,7 +389,7 @@
 	 }
 
 	 /* Use %|\texttt|% for all fonts */
-	 if (!strcmp(argv[0], "-t")) {
+	 if (!strcmp(argv[0], "-t") && argc>1) {
 		sscanf(argv[1], "%d", &TabWidth);
 		argc--, argv++;
 		argc--, argv++;
@@ -398,10 +398,11 @@
 
 	 /* specify the language */
 	 if (!strncmp(argv[0], "-l", 2)) {
-	     if (strlen(argv[0])==2) {
+	     if (strlen(argv[0])==2 && argc>1) {
 		 strcpy(language, argv[1]);
 		 argc--, argv++;
 		 argc--, argv++;
+		 continue;
 	     } else {
 		 strcpy(language, argv[0]+2);
 		 argc--, argv++;
@@ -410,13 +411,13 @@
 	 }
 
 	 /* specify the language description file for permanent use */
-	 if (!strcmp(argv[0], "-d!")) {
+	 if (!strcmp(argv[0], "-d!") && argc>1) {
 		 writeDefsfileInExe(programname, argv[1]);
 		 return OKEXIT;
 	 }
 
 	 /* specify the language description file */
-	 if (!strncmp(argv[0], "-d", 2)) { /* TODO strncmp? */
+	 if (!strncmp(argv[0], "-d", 2) && argc>1) { /* TODO strncmp? */
 		strcpy(defsfile, argv[1]);
 		argc--, argv++;
 		argc--, argv++;
@@ -424,7 +425,7 @@
 	 }
 
 	 /* specify the file containing variable substitutions */
-	 if (!strcmp(argv[0], "-v")) {
+	 if (!strcmp(argv[0], "-v") && argc>1) {
 		varsubstlist=parsevartab(argv[1]);
 		argc--, argv++;
 		argc--, argv++;


Index: tetex-lgrind.spec
===================================================================
RCS file: /cvs/extras/rpms/tetex-lgrind/FC-4/tetex-lgrind.spec,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- tetex-lgrind.spec	5 Aug 2005 17:49:48 -0000	1.11
+++ tetex-lgrind.spec	23 Aug 2005 13:55:59 -0000	1.12
@@ -6,7 +6,7 @@
 Summary:          Source-code pretty-printer for LaTeX
 Name:             tetex-lgrind
 Version:          3.67
-Release:          7%{?dist}
+Release:          9%{?dist}
 URL:              http://www.ctan.org/tex-archive/help/Catalogue/entries/lgrind.html
 License:          BSD
 Group:            Applications/Publishing
@@ -15,6 +15,8 @@
 # file contained in the tarballs have to be verified one by one.
 Source0:          ftp://ftp.dante.de/tex-archive/support/lgrind.tar.gz
 Patch0:           lgrind-3.67-parsevartab.patch
+Patch1:           lgrind-3.67-options.patch
+Patch2:           lgrind-3.67-buffersize.patch
 BuildRoot:        %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Requires(post):   tetex
 Requires(postun): tetex
@@ -34,6 +36,8 @@
 %prep
 %setup -q -n lgrind
 %patch0 -p1 -b .parsevartab
+%patch1 -p1 -b .options
+%patch2 -p1 -b .buffersize
 
 %build
 make %{?_smp_mflags} \
@@ -84,12 +88,16 @@
 %{texmf}/doc/
 
 %changelog
-* Thu Aug  4 2005 Jose Pedro Oliveira <jpo at di.uminho.pt> - 3.67-7
+* Tue Aug 23 2005 Michael Schwendt <mschwendt[AT]users.sf.net> - 3.67-9
+- Fix many segfaults in parsing of options (#166519).
+- Fix fgets buffersize in lgutil.c.
+
+* Thu Aug  4 2005 Jose Pedro Oliveira <jpo at di.uminho.pt> - 3.67-8
 - Install the dvi file where it can be found by texdoc.
 - URL updated.
 - disttag added.
 
-* Sat Jul 23 2005 Michael Schwendt <mschwendt[AT]users.sf.net> - 3.67-6.1
+* Sat Jul 23 2005 Michael Schwendt <mschwendt[AT]users.sf.net> - 3.67-7
 - Fix "missing expression in return statement" (#150297).
 
 * Sun May 22 2005 Jeremy Katz <katzj at redhat.com> - 3.67-6




More information about the scm-commits mailing list