Fix startup packet reading process.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Fri, 26 Jun 2020 11:46:33 +0000 (20:46 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Fri, 26 Jun 2020 11:59:16 +0000 (20:59 +0900)
If there are parameters other than "user", "database" and
"application_name", reading startup packet resulted in failing to
extract user: "no PostgreSQL user name specified in startup
packet". This was found while a frontend was trying to speak
replication protocol by using "replication=database".

Discussion: https://www.pgpool.net/pipermail/pgpool-general/2020-June/007162.html

src/protocol/child.c

index 6aaf52fd3cbbdc536c9a67a389a058e3b15e1199..2ee2678eed24c9d45b734109924600140a223c66 100644 (file)
@@ -682,6 +682,10 @@ read_startup_packet(POOL_CONNECTION * cp)
                                                        (errmsg("reading startup packet"),
                                                         errdetail("application_name: %s", p)));
                                }
+                               else
+                               {
+                                       p += (strlen(p) + 1);
+                               }
 
                                p += (strlen(p) + 1);
                        }