From: dlg Date: Fri, 24 Apr 2015 08:08:29 +0000 (+0000) Subject: read_defaults has the thing for strtonum to chew on in cp, not X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=7f0ae8dbd6ad61da2d7f7be64d5ebaed4448bf5a;p=openbsd read_defaults has the thing for strtonum to chew on in cp, not optarg. fixes a segfault introduced by the atoi to strtonum change and reported by ajacatout@ --- diff --git a/usr.sbin/user/user.c b/usr.sbin/user/user.c index 2026c366b03..45003754665 100644 --- a/usr.sbin/user/user.c +++ b/usr.sbin/user/user.c @@ -1,4 +1,4 @@ -/* $OpenBSD: user.c,v 1.102 2015/04/23 17:11:42 millert Exp $ */ +/* $OpenBSD: user.c,v 1.103 2015/04/24 08:08:29 dlg Exp $ */ /* $NetBSD: user.c,v 1.69 2003/04/14 17:40:07 agc Exp $ */ /* @@ -815,7 +815,7 @@ read_defaults(user_t *up) } up->u_preserve = (strncmp(cp, "true", 4) == 0) ? 1 : (strncmp(cp, "yes", 3) == 0) ? 1 : - strtonum(optarg, INT_MIN, INT_MAX, NULL); + strtonum(cp, INT_MIN, INT_MAX, NULL); } else if (strncmp(s, "expire", 6) == 0) { for (cp = s + 6 ; isspace((unsigned char)*cp); cp++) { }