[kdebindings/f14/master] - patch smoke generator invalid reads found by valgrind

Rex Dieter rdieter at fedoraproject.org
Thu Oct 7 15:38:53 UTC 2010


commit 5b5df960546da7da2eaad7754ca90a581bb7da67
Author: Rex Dieter <rdieter at fedoraproject.org>
Date:   Thu Oct 7 10:44:52 2010 -0500

    - patch smoke generator invalid reads found by valgrind

 kdebindings-4.5.2-generator-invalid-reads.patch |   37 +++++++++++++++++++++++
 kdebindings.spec                                |    8 ++++-
 2 files changed, 44 insertions(+), 1 deletions(-)
---
diff --git a/kdebindings-4.5.2-generator-invalid-reads.patch b/kdebindings-4.5.2-generator-invalid-reads.patch
new file mode 100644
index 0000000..9a3a1ed
--- /dev/null
+++ b/kdebindings-4.5.2-generator-invalid-reads.patch
@@ -0,0 +1,37 @@
+diff -ur kdebindings-4.5.2/generator/parser/rpp/pp-macro-expander.cpp kdebindings-4.5.2-generator-invalid-reads/generator/parser/rpp/pp-macro-expander.cpp
+--- kdebindings-4.5.2/generator/parser/rpp/pp-macro-expander.cpp	2009-12-31 14:35:20.000000000 +0100
++++ kdebindings-4.5.2-generator-invalid-reads/generator/parser/rpp/pp-macro-expander.cpp	2010-10-07 17:10:57.000000000 +0200
+@@ -268,10 +268,10 @@
+         output << '\"';
+ 
+         while (!is.atEnd()) {
+-          if (input == '"') {
++          if (is == '"') {
+             output << '\\' << is;
+ 
+-          } else if (input == '\n') {
++          } else if (is == '\n') {
+             output << '"' << is << '"';
+ 
+           } else {
+@@ -338,7 +338,7 @@
+             
+             skip_blanks(input, devnull());
+             //Omit paste tokens behind empty used actuals, else we will merge with the previous text
+-            if(input == '#' && (++input) == '#') {
++            if(!input.atEnd() && input == '#' && !(++input).atEnd() && input == '#') {
+               ++input;
+               //We have skipped a paste token
+             }else{
+diff -ur kdebindings-4.5.2/generator/type_compiler.cpp kdebindings-4.5.2-generator-invalid-reads/generator/type_compiler.cpp
+--- kdebindings-4.5.2/generator/type_compiler.cpp	2010-04-28 10:00:56.000000000 +0200
++++ kdebindings-4.5.2-generator-invalid-reads/generator/type_compiler.cpp	2010-10-07 17:11:33.000000000 +0200
+@@ -182,7 +182,7 @@
+     TypeCompiler tc(m_session, m_visitor);
+     tc.run(node->type_specifier, node->declarator);
+     NameCompiler name_cc(m_session, m_visitor);
+-    if (tc.type().isFunctionPointer())
++    if (tc.type().isFunctionPointer() && node->declarator && node->declarator->sub_declarator)
+         name_cc.run(node->declarator->sub_declarator->id);
+     else if (node->declarator)
+         name_cc.run(node->declarator->id);
diff --git a/kdebindings.spec b/kdebindings.spec
index 55df2af..32deea0 100644
--- a/kdebindings.spec
+++ b/kdebindings.spec
@@ -38,7 +38,7 @@
 
 Name: kdebindings
 Version: 4.5.2
-Release: 1%{?dist}
+Release: 2%{?dist}
 Summary: KDE bindings to non-C++ languages
 
 # http://techbase.kde.org/Policies/Licensing_Policy
@@ -52,6 +52,8 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 ## upstreamable patches
 # fix build with newer sip/PyQt (borrowed from opensuse)
 Patch51: kdebindings-4.5.1-sip_api_8.patch
+# fix errors found by valgrind
+Patch52: kdebindings-4.5.2-generator-invalid-reads.patch
 
 ## upstream patches
 
@@ -263,6 +265,7 @@ Falcon plugin for the Kross archtecture in KDE4.
 %if 0%{?_sip_api_major} >= 8
 %patch51 -p1 -b .sip_api_8
 %endif
+%patch52 -p1 -b .generator_invalid_reads
 
 
 %build
@@ -550,6 +553,9 @@ fi
 
 
 %changelog
+* Tue Oct 07 2010 Rex Dieter <rdieter at fedoraproject.org> - 4.5.2-2
+- patch smoke generator invalid reads found by valgrind
+
 * Fri Oct 01 2010 Rex Dieter <rdieter at fedoraproject.org> - 4.5.2-1
 - 4.5.2
 


More information about the scm-commits mailing list