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 12:00:25 +0000 (21:00 +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 8f4d26ec8f1aad3a48ddcc38edb398e1bc12c049..ee872e226459f0741604534ce347d039d36563ab 100644 (file)
@@ -638,6 +638,10 @@ static StartupPacket *read_startup_packet(POOL_CONNECTION *cp)
                                                (errmsg("reading startup packet"),
                                                         errdetail("application_name: %s", p)));
                                }
+                               else
+                               {
+                                       p += (strlen(p) + 1);
+                               }
 
                                p += (strlen(p) + 1);
                        }