bucardo / dbdpg

Perl Postgres driver DBD::Pg aka dbdpg
48 stars 36 forks source link

Crash in the absence of client_encoding #29

Closed johto closed 7 years ago

johto commented 7 years ago

DBD::Pg crashes the Perl process in pg_db_detect_client_encoding_utf8() if the server doesn't send client_encoding as a startup parameter. This is fine if you're connecting to a vanilla postgres, but less so if you're connecting to one which only speaks the wire protocol but doesn't care as much about encodings and such. I'm not sure whether this should be considered a bug or not, but I thought I'd open a ticket anyway. Segmentation faults certainly don't look nice.

machack666 commented 7 years ago

Looks like this is due to not checking for NULL in a PQparameterStatus() call. Will push a fix for this.

machack666 commented 7 years ago

Fixed in f29a19e, also found/fixed a similar unlikely crash as well.

Thanks for the report.