From db7d0160b56c7cf259bf31666972a4b30732675b Mon Sep 17 00:00:00 2001 From: Petr Machata Date: Apr 20 2009 11:26:12 +0000 Subject: - Resolves: #496548. Mon Apr 20 2009 Petr Machata - 2.5.35-4 - Get rid of warning caused by ignoring return value of fwrite() in ECHO macro. Debian patch. - Resolves: #484961 --- diff --git a/flex-2.5.35-hardening.patch b/flex-2.5.35-hardening.patch new file mode 100644 index 0000000..7d608ea --- /dev/null +++ b/flex-2.5.35-hardening.patch @@ -0,0 +1,36 @@ +diff -u flex-2.5.35/scan.c flex-2.5.35/scan.c +--- flex-2.5.35/scan.c ++++ flex-2.5.35/scan.c +@@ -2096,7 +2096,7 @@ + /* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +-#define ECHO fwrite( yytext, yyleng, 1, yyout ) ++#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) + #endif + + /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, +diff -u flex-2.5.35/flex.skl flex-2.5.35/flex.skl +--- flex-2.5.35/flex.skl ++++ flex-2.5.35/flex.skl +@@ -1075,7 +1075,7 @@ + /* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +-#define ECHO fwrite( yytext, yyleng, 1, yyout ) ++#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) + %endif + %if-c++-only C++ definition + #define ECHO LexerOutput( yytext, yyleng ) +diff -u flex-2.5.35/skel.c flex-2.5.35/skel.c +--- flex-2.5.35/skel.c ++++ flex-2.5.35/skel.c +@@ -1142,7 +1142,7 @@ + "/* This used to be an fputs(), but since the string might contain NUL's,", + " * we now use fwrite().", + " */", +- "#define ECHO fwrite( yytext, yyleng, 1, yyout )", ++ "#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)", + "%endif", + "%if-c++-only C++ definition", + "#define ECHO LexerOutput( yytext, yyleng )", diff --git a/flex.spec b/flex.spec index f31a119..778f440 100644 --- a/flex.spec +++ b/flex.spec @@ -1,12 +1,14 @@ Summary: A tool for creating scanners (text pattern recognizers) Name: flex Version: 2.5.35 -Release: 3%{?dist} +Release: 4%{?dist} License: BSD Group: Development/Tools URL: http://flex.sourceforge.net/ Source: flex-%{version}.tar.bz2 Patch0: flex-2.5.35-sign.patch +Patch1: flex-2.5.35-hardening.patch +Patch2: flex-2.5.35-gcc44.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: m4 BuildRequires: gettext bison m4 @@ -30,6 +32,8 @@ application development. %prep %setup -q %patch0 -p1 +%patch1 -p1 +%patch2 -p1 %build %configure --disable-dependency-tracking CFLAGS="-fPIC $RPM_OPT_FLAGS" @@ -76,6 +80,14 @@ rm -rf ${RPM_BUILD_ROOT} %{_infodir}/flex.info* %changelog +* Mon Apr 20 2009 Debarshi Ray - 2.5.35-4 +- Resolves: #496548. + +* Mon Apr 20 2009 Petr Machata - 2.5.35-4 +- Get rid of warning caused by ignoring return value of fwrite() in + ECHO macro. Debian patch. +- Resolves: #484961 + * Tue Feb 24 2009 Fedora Release Engineering - 2.5.35-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild