artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2b41d79
)
set the return pointer to NULL when receiving a 0-sized data.
author
eric
<eric@openbsd.org>
Mon, 17 Dec 2018 08:56:31 +0000
(08:56 +0000)
committer
eric
<eric@openbsd.org>
Mon, 17 Dec 2018 08:56:31 +0000
(08:56 +0000)
ok gilles
usr.sbin/smtpd/mproc.c
patch
|
blob
|
history
diff --git
a/usr.sbin/smtpd/mproc.c
b/usr.sbin/smtpd/mproc.c
index
f1175f7
..
d5a934d
100644
(file)
--- a/
usr.sbin/smtpd/mproc.c
+++ b/
usr.sbin/smtpd/mproc.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: mproc.c,v 1.3
1 2018/12/13 17:08:10 gilles Exp $
*/
+/* $OpenBSD: mproc.c,v 1.3
2 2018/12/17 08:56:31 eric Exp $
*/
/*
* Copyright (c) 2012 Eric Faurot <eric@faurot.net>
@@
-583,6
+583,11
@@
m_get_data(struct msg *m, const void **data, size_t *sz)
{
m_get_size(m, sz);
+ if (*sz == 0) {
+ *data = NULL;
+ return;
+ }
+
if (m->pos + *sz > m->end)
m_error("msg too short");