[xchat-ruby] Fix null pointer dereference (#787298 reported by Pallai Roland)

konradm konradm at fedoraproject.org
Sat Feb 4 02:02:20 UTC 2012


commit 5c1f30e80997aa96c863038130760ab851df7dde
Author: Conrad Meyer <cemeyer at uw.edu>
Date:   Fri Feb 3 18:02:02 2012 -0800

    Fix null pointer dereference (#787298 reported by Pallai Roland)

 xchat-ruby-1.2-fix-null-ptr-deref.diff |   20 ++++++++++++++++++++
 xchat-ruby.spec                        |    7 ++++++-
 2 files changed, 26 insertions(+), 1 deletions(-)
---
diff --git a/xchat-ruby-1.2-fix-null-ptr-deref.diff b/xchat-ruby-1.2-fix-null-ptr-deref.diff
new file mode 100644
index 0000000..d389247
--- /dev/null
+++ b/xchat-ruby-1.2-fix-null-ptr-deref.diff
@@ -0,0 +1,20 @@
+--- xchat-ruby-1.2-src/src/xchat-ruby.c.orig	2007-04-26 13:16:32.000000000 +0200
++++ xchat-ruby-1.2-src/src/xchat-ruby.c	2012-02-03 21:01:12.779969703 +0100
+@@ -773,7 +773,7 @@ static int static_ruby_custom_command_ho
+   rb_word = rb_ary_new();
+   rb_word_eol = rb_ary_new();
+ 
+-  for( i = 1; word[i][0] != '\0'; i++ )
++  for( i = 1; word[i] && word[i][0] != '\0'; i++ )
+   {
+     rb_ary_push( rb_word, rb_str_new2( word[i] ) );
+     rb_ary_push( rb_word_eol, rb_str_new2( word_eol[i] ) );
+@@ -828,7 +828,7 @@ static int static_ruby_custom_server_hoo
+   rb_word = rb_ary_new();
+   rb_word_eol = rb_ary_new();
+ 
+-  for( i = 1; word[i][0] != '\0'; i++ )
++  for( i = 1; word[i] && word[i][0] != '\0'; i++ )
+   {
+     rb_ary_push( rb_word, rb_str_new2( word[i] ) );
+     rb_ary_push( rb_word_eol, rb_str_new2( word_eol[i] ) );
diff --git a/xchat-ruby.spec b/xchat-ruby.spec
index 4239859..19f1062 100644
--- a/xchat-ruby.spec
+++ b/xchat-ruby.spec
@@ -1,6 +1,6 @@
 Name: xchat-ruby
 Version: 1.2
-Release: 10%{?dist}
+Release: 11%{?dist}
 Summary: An X-Chat plugin providing scripting functionality with Ruby
 
 Group: Applications/Internet
@@ -11,6 +11,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 Patch0: xchat-ruby-global-rubyenv.patch
 Patch1: xchat-ruby-dont-ignore-cflags.patch
+Patch2: xchat-ruby-1.2-fix-null-ptr-deref.diff
 
 BuildRequires: ruby(abi) = 1.8
 BuildRequires: ruby-devel ruby
@@ -29,6 +30,7 @@ language in which to write X-Chat plugins.
 %setup -q -n xchat-ruby-%{version}-src
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 
 %build
@@ -69,6 +71,9 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Fri Feb 3 2012 Conrad Meyer <konrad at tylerc.org> - 1.2-11
+- Fix null pointer dereference (#787298 reported by Pallai Roland)
+
 * Sat Jan 14 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.2-10
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
 


More information about the scm-commits mailing list