Author: bapt Date: Fri Aug 21 14:28:14 2015 New Revision: 286993 URL: https://svnweb.freebsd.org/changeset/base/286993
Log: Fix err pointer not initialized to NULL resulting Reported by: "O. Hartmann" <ohart...@zedat.fu-berlin.de> Modified: head/usr.sbin/pw/strtounum.c head/usr.sbin/pw/tests/pw_useradd.sh Modified: head/usr.sbin/pw/strtounum.c ============================================================================== --- head/usr.sbin/pw/strtounum.c Fri Aug 21 14:15:54 2015 (r286992) +++ head/usr.sbin/pw/strtounum.c Fri Aug 21 14:28:14 2015 (r286993) @@ -41,6 +41,7 @@ strtounum(const char * __restrict np, ui char *endp; uintmax_t ret; + *errpp = NULL; if (minval > maxval) { errno = EINVAL; if (errpp != NULL) Modified: head/usr.sbin/pw/tests/pw_useradd.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_useradd.sh Fri Aug 21 14:15:54 2015 (r286992) +++ head/usr.sbin/pw/tests/pw_useradd.sh Fri Aug 21 14:28:14 2015 (r286993) @@ -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 } _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"