rpms/cscope/F-11 cscope-15.6-lexerr.patch, NONE, 1.1 cscope.spec, 1.37, 1.38

Neil Horman nhorman at fedoraproject.org
Fri Aug 28 14:56:48 UTC 2009


Author: nhorman

Update of /cvs/extras/rpms/cscope/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv29319

Modified Files:
	cscope.spec 
Added Files:
	cscope-15.6-lexerr.patch 
Log Message:
Resolves: bz 520073

cscope-15.6-lexerr.patch:
 crossref.c |    1 +
 fscanner.l |    4 ++++
 scanner.h  |    5 +++--
 3 files changed, 8 insertions(+), 2 deletions(-)

--- NEW FILE cscope-15.6-lexerr.patch ---
diff -up cscope-15.6/src/crossref.c.orig cscope-15.6/src/crossref.c
--- cscope-15.6/src/crossref.c.orig	2006-09-30 04:13:00.000000000 -0400
+++ cscope-15.6/src/crossref.c	2009-08-28 10:47:26.000000000 -0400
@@ -176,6 +176,7 @@ crossref(char *srcfile)
 #endif
 	    break;
 			
+	case LEXERR:	/* Lexer error, abort further parsing of this file */
 	case LEXEOF:	/* end of file; last line may not have \n */
 			
 			/* if there were symbols, output them and the source line */
diff -up cscope-15.6/src/fscanner.l.orig cscope-15.6/src/fscanner.l
--- cscope-15.6/src/fscanner.l.orig	2006-09-30 10:43:06.000000000 -0400
+++ cscope-15.6/src/fscanner.l	2009-08-28 10:47:26.000000000 -0400
@@ -399,6 +399,8 @@ wsnl		[ \t\r\v\f\n]|{comment}
 			/* NOTREACHED */
 		}
 =		{	/* if a global definition initializer */
+			if (!my_yytext)
+				return(LEXERR);
 			if (global == YES && ppdefine == NO && my_yytext[0] != '#') {
 				initializerbraces = braces;
 				initializer = YES;
@@ -407,6 +409,8 @@ wsnl		[ \t\r\v\f\n]|{comment}
 			/* NOTREACHED */
 		}
 :		{	/* a if global structure field */
+			if (!my_yytext)
+				return(LEXERR);
 			if (global == YES && ppdefine == NO && my_yytext[0] != '#') {
 				structfield = YES;
 			}
diff -up cscope-15.6/src/scanner.h.orig cscope-15.6/src/scanner.h
--- cscope-15.6/src/scanner.h.orig	2006-09-30 04:13:00.000000000 -0400
+++ cscope-15.6/src/scanner.h	2009-08-28 10:47:26.000000000 -0400
@@ -61,8 +61,9 @@
 
 /* other scanner token types */
 #define LEXEOF	0
-#define	IDENT	1
-#define	NEWLINE	2
+#define LEXERR	1
+#define	IDENT	2	
+#define	NEWLINE	3	
 
 /* scanner.l global data */
 extern	int	first;		/* buffer index for first char of symbol */


Index: cscope.spec
===================================================================
RCS file: /cvs/extras/rpms/cscope/F-11/cscope.spec,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -p -r1.37 -r1.38
--- cscope.spec	24 Feb 2009 09:59:40 -0000	1.37
+++ cscope.spec	28 Aug 2009 14:56:47 -0000	1.38
@@ -1,7 +1,7 @@
 Summary: C source code tree search and browse tool 
 Name: cscope
 Version: 15.6
-Release: 3%{?dist}
+Release: 4%{?dist}
 Source0: http://unc.dl.sourceforge.net/sourceforge/cscope/cscope-15.6.tar.gz 
 URL: http://cscope.sourceforge.net
 License: BSD 
@@ -18,6 +18,7 @@ Patch1:cscope-15.6-ocs.patch
 Patch2:cscope-15.6-xcscope-man.patch
 Patch3:cscope-15.6-sigwinch-linemode.patch
 Patch4:cscope-15.6-qrebuild.patch
+Patch5:cscope-15.6-lexerr.patch
 
 %description
 cscope is a mature, ncurses based, C source code tree browsing tool.  It 
@@ -33,6 +34,7 @@ matches for use in file editing.
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
 
 %build
 %configure
@@ -81,6 +83,9 @@ rm -f %{xemacs_lisp_path}/xcscope.el
 rm -f %{emacs_lisp_path}/xcscope.el
 
 %changelog
+* Fri Aug 28 2009 Neil Horman <nhorman at redhat.com> - 15.6-4
+- Backport lexerr patch to fix segfult in lexer (bz 520073)
+
 * Tue Feb 24 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 15.6-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
 




More information about the scm-commits mailing list