mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 04:43:53 +00:00
Fix err pointer not initialized to NULL resulting
Reported by: "O. Hartmann" <ohartman@zedat.fu-berlin.de>
This commit is contained in:
parent
f1868b4309
commit
bb1816daa4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=286993
|
@ -41,6 +41,7 @@ strtounum(const char * __restrict np, uintmax_t minval, uintmax_t maxval,
|
|||
char *endp;
|
||||
uintmax_t ret;
|
||||
|
||||
*errpp = NULL;
|
||||
if (minval > maxval) {
|
||||
errno = EINVAL;
|
||||
if (errpp != NULL)
|
||||
|
|
|
@ -338,6 +338,20 @@ user_add_w_yes_body() {
|
|||
grep "^foo" ${HOME}/master.passwd
|
||||
}
|
||||
|
||||
atf_test_case user_add_with_pw_conf
|
||||
user_add_with_pw_conf_body()
|
||||
{
|
||||
populate_etc_skel
|
||||
atf_check -s exit:0 \
|
||||
${PW} useradd -D -C ${HOME}/pw.conf \
|
||||
-u 2000,32767 -i 2000,32767
|
||||
atf_check -s exit:0 \
|
||||
-o inline:"minuid = 2000\nmaxuid = 32767\nmingid = 2000\nmaxgid = 32767\n" \
|
||||
grep "^m.*id =" ${HOME}/pw.conf
|
||||
atf_check -s exit:0 \
|
||||
${PW} useradd foo -C ${HOME}/pw.conf
|
||||
}
|
||||
|
||||
atf_init_test_cases() {
|
||||
atf_add_test_case user_add
|
||||
atf_add_test_case user_add_noupdate
|
||||
|
@ -367,4 +381,5 @@ atf_init_test_cases() {
|
|||
atf_add_test_case user_add_bad_shell
|
||||
atf_add_test_case user_add_already_exists
|
||||
atf_add_test_case user_add_w_yes
|
||||
atf_add_test_case user_add_with_pw_conf
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue