agroal / pgagroal

High-performance connection pool for PostgreSQL
https://agroal.github.io/pgagroal/
BSD 3-Clause "New" or "Revised" License
667 stars 59 forks source link

Segmentation Fault in `pgagroal-cli` when no command is specified #406

Closed decarv closed 4 months ago

decarv commented 4 months ago

Describe the bug

The issue was first discussed here. The execution of pgagroal-cli can raise segmentation fault when no command is specified, but a password is specified.

The segfault occurs because the program attempts to free a password that points to a position in *argv.

To Reproduce

Run pgagroal-cli in the shell without a command while specifying password:

./pgagroal-cli -h localhost -p 2345 -U test -P test

Version

$ ./pgagroal -V
pgagroal 1.7.0

Configuration

Configuration found here: https://github.com/agroal/pgagroal/blob/master/doc/GETTING_STARTED.md#configuration