michelp / pgsodium

Modern cryptography for PostgreSQL using libsodium.
Other
546 stars 32 forks source link

fix: crash on macos 13.0.1 #39

Closed burmecia closed 1 year ago

burmecia commented 1 year ago

This uninitialized pointer secret_buf caused crash when getline() is called on macOS 13.0.1. As the man page said:

If *lineptr is set to NULL before the call, then getline() will allocate a buffer for storing the line.

So it's better to always initialize pointer to NULL.