pgpool2.git / summary / log / commit / refs
commit 8af298fbce50c01172a0583de11f0984acefa717
Author: Yoshiyuki Asaba <y-asaba at pgfoundry.org>
Date: Tue May 22 06:28:41 2007 +0000
Add checking a message length is valid.
(Reported by Fujii Masao)
pool_process_query.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/pool_process_query.c b/pool_process_query.c
index 5c754b972..ee1466b8c 100644
--- a/pool_process_query.c
+++ b/pool_process_query.c
@@ -3272,8 +3272,13 @@ POOL_STATUS SimpleForwardToBackend(char kind, POOL_CONNECTION *frontend, POOL_CO
}
}
- if (len <= 0)
+ if (len == 0)
return POOL_CONTINUE;
+ else if (len < 0)
+ {
+ pool_error("SimpleForwardToBackend: invalid message length");
+ return POOL_END;
+ }
p = pool_read2(frontend, len);
if (p == NULL)
[parent: 4320e6ccc8b7]