diff options
author | tobhe <tobhe@openbsd.org> | 2020-03-17 09:01:53 +0000 |
---|---|---|
committer | tobhe <tobhe@openbsd.org> | 2020-03-17 09:01:53 +0000 |
commit | a455961d1f36f46c791c72be5feed313f1760485 (patch) | |
tree | e29ff2987037f0ca96290d69b35c243e211ff161 | |
parent | Initialize session.rcptto to NULL before parsing command line optinos. (diff) | |
download | OpenSMTPD-a455961d1f36f46c791c72be5feed313f1760485.tar.xz OpenSMTPD-a455961d1f36f46c791c72be5feed313f1760485.zip |
Exit when m_get_string() returns NULL to prevent nullptr dereference in
strlen().
ok millert@
-rw-r--r-- | mproc.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: mproc.c,v 1.35 2019/10/03 05:50:28 gilles Exp $ */ +/* $OpenBSD: mproc.c,v 1.36 2020/03/17 09:01:53 tobhe Exp $ */ /* * Copyright (c) 2012 Eric Faurot <eric@faurot.net> @@ -637,6 +637,8 @@ m_get_envelope(struct msg *m, struct envelope *evp) m_get_evpid(m, &evpid); m_get_string(m, &buf); + if (buf == NULL) + fatalx("empty envelope buffer"); if (!envelope_load_buffer(evp, buf, strlen(buf))) fatalx("failed to retrieve envelope"); |