[packages/pccts] add format security patch
glen
glen at pld-linux.org
Sat Mar 21 19:47:24 CET 2015
commit 2d6f8496b35ae58b4ee1f2ceaf27a2b5e3d38bbf
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Sat Mar 21 20:47:14 2015 +0200
add format security patch
format-security.patch | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++
pccts.spec | 4 +++-
2 files changed, 68 insertions(+), 1 deletion(-)
---
diff --git a/pccts.spec b/pccts.spec
index c6d3b9f..2fd455f 100644
--- a/pccts.spec
+++ b/pccts.spec
@@ -3,7 +3,7 @@ Summary(pl.UTF-8): Zestaw narzędzi do tworzenia kompilatorów
Summary(pt_BR.UTF-8): PCCTS - The Purdue Compiler Construction Tool Set
Name: pccts
Version: 1.33MR33
-Release: 9
+Release: 10
License: Public Domain
Group: Development/Tools
Source0: http://www.polhode.com/%{name}133mr.zip
@@ -13,6 +13,7 @@ Source1: http://www.polhode.com/%{name}bk2.pdf
Source2: http://www.antlr.org/1.33/tutorial.zip
# Source2-md5: 223c7b096d22c44fd1fbbbd84b392f01
Patch0: %{name}-antlr.patch
+Patch1: format-security.patch
URL: http://www.polhode.com/pccts.html
BuildRequires: unzip
Obsoletes: pccts-antlr
@@ -54,6 +55,7 @@ um conjunto maior de problemas de tradução.
%prep
%setup -q -n %{name} -a2
%patch0
+%patch1 -p1
sed -i -e 's#/usr/local/pccts#%{_libdir}/%{name}#g' support/genmk/genmk.c
rm bin/empty.txt
diff --git a/format-security.patch b/format-security.patch
new file mode 100644
index 0000000..a13bc2c
--- /dev/null
+++ b/format-security.patch
@@ -0,0 +1,65 @@
+--- pccts/antlr/lex.c~ 2001-08-09 14:50:33.000000000 +0300
++++ pccts/antlr/lex.c 2015-03-21 17:17:22.568752584 +0200
+@@ -706,7 +706,7 @@
+ /* MR26 */ if (! (isalpha(*t) || isdigit(*t) || *t == '_' || *t == '$')) break;
+ /* MR26 */ }
+ /* MR26 */ }
+-/* MR26 */ fprintf(output,strBetween(pSymbol, t, pSeparator));
++/* MR26 */ fputs(strBetween(pSymbol, t, pSeparator),output);
+
+ *q = p;
+ return (*pSeparator == 0);
+@@ -771,7 +771,7 @@
+ &pValue,
+ &pSeparator,
+ &nest);
+- fprintf(f,strBetween(pDataType, pSymbol, pSeparator));
++ fputs(strBetween(pDataType, pSymbol, pSeparator), f);
+ }
+
+ /* check to see if string e is a word in string s */
+@@ -852,9 +852,9 @@
+ &pSeparator,
+ &nest);
+ fprintf(f,"\t");
+- fprintf(f,strBetween(pDataType, pSymbol, pSeparator));
++ fputs(strBetween(pDataType, pSymbol, pSeparator), f);
+ fprintf(f," ");
+- fprintf(f,strBetween(pSymbol, pEqualSign, pSeparator));
++ fputs(strBetween(pSymbol, pEqualSign, pSeparator), f);
+ fprintf(f,";\n");
+ }
+ fprintf(f,"};\n");
+--- pccts/antlr/fset2.c~ 2001-08-28 00:30:55.000000000 +0300
++++ pccts/antlr/fset2.c 2015-03-21 20:40:47.213771506 +0200
+@@ -2210,7 +2210,7 @@
+ if (p->ntype != nToken) continue;
+ tn=(TokNode *)p;
+ if (depth != 0) fprintf(stdout," ");
+- fprintf(stdout,TerminalString(tn->token));
++ fputs(TerminalString(tn->token), stdout);
+ depth++;
+ if (! MR_AmbAidMultiple) {
+ if (set_nil(tn->tset)) {
+--- pccts/antlr/gen.c~ 2002-03-04 04:34:22.000000000 +0200
++++ pccts/antlr/gen.c 2015-03-21 20:42:27.175611201 +0200
+@@ -3866,7 +3866,7 @@
+ /* MR10 */ _gen(" * ");
+ /* MR10 */ for (i=0 ; i < Save_argc ; i++) {
+ /* MR10 */ _gen(" ");
+-/* MR10 */ _gen(Save_argv[i]);
++/* MR10 */ _gen1("%s", Save_argv[i]);
+ /* MR10 */ };
+ _gen("\n");
+ _gen(" *\n");
+--- pccts/sorcerer/main.c~ 2001-06-03 20:37:29.000000000 +0300
++++ pccts/sorcerer/main.c 2015-03-21 20:45:02.877002088 +0200
+@@ -1035,7 +1035,7 @@
+ id = p; /* here is where id is */
+ p = s;
+ while ( p!=id ) {fputc(*p, f); p++;} /* dump until just before variable */
+- fprintf(f, prefix);
++ fputs(prefix,f);
+ while ( isspace(*p) ) p++;
+ while ( *p!='\0' ) /* dump rest */
+ {
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/pccts.git/commitdiff/2d6f8496b35ae58b4ee1f2ceaf27a2b5e3d38bbf
More information about the pld-cvs-commit
mailing list