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:
8ccac24
)
swrap: Add an overflow check
author
Volker Lendecke
<vl@samba.org>
Sat, 29 Dec 2018 19:20:13 +0000
(20:20 +0100)
committer
Andreas Schneider
<asn@samba.org>
Fri, 11 Jan 2019 13:16:59 +0000
(14:16 +0100)
Signed-off-by: Volker Lendecke <vl@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 df70df5008d86dbac9aa759adba3c412d2d24550..a0e1df044a6d7b8f02af99e6f9317cb76a9af624 100644
(file)
--- a/
src/socket_wrapper.c
+++ b/
src/socket_wrapper.c
@@
-4752,6
+4752,11
@@
static ssize_t swrap_sendmsg_before(int fd,
for (i = 0; i < (size_t)msg->msg_iovlen; i++) {
size_t nlen;
nlen = len + msg->msg_iov[i].iov_len;
+ if (nlen < len) {
+ /* overflow */
+ errno = EMSGSIZE;
+ goto out;
+ }
if (nlen > mtu) {
break;
}