Fixed memory corruption issue in slonik.
authorSteve Singer <ssinger@ca.afilias.info>
Fri, 27 May 2011 19:06:01 +0000 (15:06 -0400)
committerSteve Singer <ssinger@ca.afilias.info>
Fri, 27 May 2011 19:06:01 +0000 (15:06 -0400)
If slonik tries to get the last event id from
a node that does not yet have slony installed it skips
over the element in the return array. This has the effect
of returning leaving that element uninitialized.
Instead set it to -1.

RELEASE
src/slonik/slonik.c

diff --git a/RELEASE b/RELEASE
index d3fbd3114a17591ef4d16c78760a6bd8d6a7c7f8..b9b3938e4f3dcffa10702680eade2389846655d2 100644 (file)
--- a/RELEASE
+++ b/RELEASE
@@ -2,6 +2,9 @@
 
 - Bug 214 - Add slonikconfdump.sh back into tools
 
+- Fixed slonik memory corruption when it tries to get the last known
+  event_id from a node that doesn't yet have slony installed.
+
 * 2.1.0 (beta 2)
 - Bug #204 -  Upgrade from 2.0.x fails under PostgreSQL 8.3
 
index 333dd2e9c95d9ba16e920a41e069803763ac1ff0..165145d40acc7fb49235caea6246bbc3e4920ef9 100644 (file)
@@ -5383,6 +5383,7 @@ static size_t slonik_get_last_event_id(SlonikStmt *stmt,
                        /**
                         * warning?
                         */
+                       (*events)[node_idx]=-1;
                        continue;
                }
                rc = slonik_is_slony_installed(stmt,activeAdmInfo);