]> git.ipfire.org Git - thirdparty/shadow.git/commit
chgpasswd: fix segfault in command-line options
authorJeffrey Bencteux <jeffbencteux@gmail.com>
Wed, 21 Jun 2023 13:12:43 +0000 (15:12 +0200)
committerSerge Hallyn <serge@hallyn.com>
Thu, 22 Jun 2023 19:51:34 +0000 (14:51 -0500)
commit53a17c1742a4b5fcf9280fd6dd85fc77588535c2
treea762d43b07cdbd588321c158429514dc28015bed
parent65c88a43a23c2391dcc90c0abda3e839e9c57904
chgpasswd: fix segfault in command-line options

Using the --sha-rounds option without first giving a crypt method via the --crypt-method option results in comparisons with a NULL pointer and thus make chgpasswd segfault:

$ chgpasswd -s 1
zsh: segmentation fault  chgpasswd -s 1

Current patch add a sanity check before these comparisons to ensure there is a defined encryption method.
src/chgpasswd.c