pgpool2.git / summary / log / commit / refs

commit    50dca7324ea2b11ad30117245d46841322d70026
Author:   Yoshiyuki Asaba <y-asaba at pgfoundry.org>
Date:     Thu Oct 18 09:57:45 2007 +0000

    Although the second argument of PQunescapeBytea() requires size_t
    which size is 8 byte in 64bit machine, pgpool passed 4 byte variable.
    It caused segfault. So fixed passing size_t variable.


pool_query_cache.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pool_query_cache.c b/pool_query_cache.c index 87f0f167c..4f38882f6 100644 --- a/pool_query_cache.c +++ b/pool_query_cache.c @@ -547,9 +547,11 @@ search_system_db_for_cache(POOL_CONNECTION *frontend, char *sql, int sql_len, st static int ForwardCacheToFrontend(POOL_CONNECTION *frontend, char *cache, char tstate) { int sendlen; + size_t sz; char *binary_cache = NULL; - binary_cache = (char *)PQunescapeBytea((unsigned char *)cache, (unsigned int *)&sendlen); + binary_cache = (char *)PQunescapeBytea((unsigned char *)cache, &sz); + sendlen = (int) sz; if (malloc_failed(binary_cache)) return -1; [parent: cc7a004f8cad]