From 525b4535caa65d86495e83759239f4968c430fe8 Mon Sep 17 00:00:00 2001 From: mame Date: Thu, 9 Oct 2008 12:18:42 +0000 Subject: [PATCH] * ext/syck/syck.c (syck_lookup_sym): remove reading uninitialized variable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ ext/syck/syck.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index dc2c953990..7bdf9eee63 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Oct 9 21:17:50 2008 Yusuke Endoh + + * ext/syck/syck.c (syck_lookup_sym): remove reading uninitialized + variable. + Thu Oct 9 16:34:15 2008 NARUSE, Yui * ext/json/ext/generator/extconf.rb: fix target. diff --git a/ext/syck/syck.c b/ext/syck/syck.c index 92b7566d1a..e0fc2bc244 100644 --- a/ext/syck/syck.c +++ b/ext/syck/syck.c @@ -192,11 +192,11 @@ syck_add_sym( SyckParser *p, void *data ) int syck_lookup_sym( SyckParser *p, SYMID id, void **datap ) { - st_data_t data = (st_data_t)*datap; + st_data_t data; int ret; if ( p->syms == NULL ) return 0; ret = st_lookup( p->syms, id, &data ); - *datap = (void *)data; + if(ret) *datap = (void *)data; return ret; }