git.samba.org
/
socket_wrapper.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2b8a9e3
)
swrap: don't touch msg_tmp in swrap_recvmsg_after_unix() on error
author
Stefan Metzmacher
<metze@samba.org>
Tue, 9 Feb 2021 15:09:59 +0000
(16:09 +0100)
committer
Andreas Schneider
<asn@samba.org>
Tue, 9 Feb 2021 15:53:48 +0000
(16:53 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
src/socket_wrapper.c
patch
|
blob
|
history
diff --git
a/src/socket_wrapper.c
b/src/socket_wrapper.c
index 6a63530ba7ac72f13b4d2ac6654574606afb3735..59fb07dc5909274633927440190e46038c740392 100644
(file)
--- a/
src/socket_wrapper.c
+++ b/
src/socket_wrapper.c
@@
-6021,6
+6021,16
@@
static ssize_t swrap_recvmsg_after_unix(struct msghdr *msg_tmp,
size_t cm_data_space = 0;
int rc = -1;
+ if (ret < 0) {
+ int saved_errno = errno;
+ SWRAP_LOG(SWRAP_LOG_TRACE, "ret=%zd - %d - %s", ret,
+ saved_errno, strerror(saved_errno));
+ SAFE_FREE(*tmp_control);
+ /* msg_out should not be touched on error */
+ errno = saved_errno;
+ return ret;
+ }
+
SWRAP_LOG(SWRAP_LOG_TRACE,
"msg_tmp->msg_controllen=%zu",
(size_t)msg_tmp->msg_controllen);