session: handle NULL return values of crypt()
authorJo-Philipp Wich <jo@mein.io>
Wed, 22 May 2019 12:25:52 +0000 (14:25 +0200)
committerJo-Philipp Wich <jo@mein.io>
Wed, 22 May 2019 12:25:52 +0000 (14:25 +0200)
commit569284a119f958154fe076f5bc06b031d59a71cc
treec4d8820ff5600ce8db782435deefac6d71c32b4b
parentd610800a0f483a0f4af58f08bc4ac84c4ba3e07e
session: handle NULL return values of crypt()

The crypt() function may return NULL with errno ENOSYS when an attempt
was made to crypt the plaintext password using a salt requesting an
unsupported cipher.

Avoid triggering segmentation faults in the subsequent strcmp() operation
by checking for a non-NULL hash value.

Fixes: FS#2291
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
session.c