diff options
author | Jeremy Allison <jra@samba.org> | 2013-12-12 09:37:25 -0800 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2013-12-16 15:17:58 +0100 |
commit | ef5a3bedab74420baf0c653cf8e304fe6c2a13b4 (patch) | |
tree | 5b76c9b7161a13af754deaa9cdf137b6162ab5f8 /source3/utils/net.c | |
parent | 5ac5e335e0596583e11a750d31f133da3fad8fd4 (diff) | |
download | samba-ef5a3bedab74420baf0c653cf8e304fe6c2a13b4.tar.gz samba-ef5a3bedab74420baf0c653cf8e304fe6c2a13b4.tar.xz samba-ef5a3bedab74420baf0c653cf8e304fe6c2a13b4.zip |
s3: smbpasswd - fix crashes on invalid input.
get_pass can return NULL on error. Ensure that
this is always the case and fix all callers to cope
(some already did).
Reported by Joonas Kuorilehto <joneskoo@codenomicon.com>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10320
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Dec 16 15:17:58 CET 2013 on sn-devel-104
Diffstat (limited to 'source3/utils/net.c')
-rw-r--r-- | source3/utils/net.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/utils/net.c b/source3/utils/net.c index 3473641630..1308d9492e 100644 --- a/source3/utils/net.c +++ b/source3/utils/net.c @@ -105,6 +105,11 @@ static int net_changesecretpw(struct net_context *c, int argc, } trust_pw = get_pass(_("Enter machine password: "), c->opt_stdin); + if (trust_pw == NULL) { + d_fprintf(stderr, + _("Error in reading machine password\n")); + return 1; + } if (!secrets_store_machine_password(trust_pw, lp_workgroup(), sec_channel_type)) { d_fprintf(stderr, |