summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTatsuo Ishii2012-11-15 23:09:08 +0000
committerTatsuo Ishii2012-11-15 23:18:37 +0000
commitc4a219c6c83b1b28ff1a53a8642f473843f42893 (patch)
treedd0e3807b03ed8f7c9b43aaa110ae1aed296e5ab
parent3091b8fe2eeb02c3188ee7191b2bb9203a5bdd28 (diff)
Fix pool_send_severity_message() not to use uninitialized memory.V2_2_STABLE
Reported in Bug#33's attached valgrind output: ==20875== Syscall param write(buf) points to uninitialised byte(s) ==20875== at 0x52680D0: __write_nocancel (syscall-template.S:82) ==20875== by 0x41CC49: pool_flush_it (pool_stream.c:436) ==20875== by 0x41CCF8: pool_flush (pool_stream.c:496) ==20875== by 0x417AE4: pool_send_severity_message (pool_process_query.c:1722) ==20875== by 0x417C12: pool_send_error_message (pool_process_query.c:1608) ==20875== by 0x4182A0: read_kind_from_backend (pool_process_query.c:3768) ==20875== by 0x449098: ProcessBackendResponse (pool_proto_modules.c:2562) ==20875== by 0x41B9C4: pool_process_query (pool_process_query.c:274) ==20875== by 0x40B1DF: do_child (child.c:362) ==20875== by 0x404BD4: fork_a_child (main.c:1243) ==20875== by 0x40795B: main (main.c:661) ==20875== Address 0x87cb243 is 275 bytes inside a block of size 8,192 alloc'd ==20875== at 0x4C244E8: malloc (vg_replace_malloc.c:236) ==20875== by 0x41CEF4: pool_open (pool_stream.c:68) ==20875== by 0x40A7B2: do_accept (child.c:784) ==20875== by 0x40AA2A: do_child (child.c:185) ==20875== by 0x404BD4: fork_a_child (main.c:1243) ==20875== by 0x40795B: main (main.c:661)
-rw-r--r--pool_process_query.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/pool_process_query.c b/pool_process_query.c
index b3dd1cdc7..ea0a32f71 100644
--- a/pool_process_query.c
+++ b/pool_process_query.c
@@ -2620,6 +2620,7 @@ void pool_send_severity_message(POOL_CONNECTION *frontend, int protoMajor,
int sendlen;
len = 0;
+ memset(data, 0, MAXDATA);
pool_write(frontend, "E", 1);