chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0193ad2
)
libudev: fix check for too long packet
author
Topi Miettinen
<toiwoton@gmail.com>
Sun, 18 Jan 2015 21:57:35 +0000
(23:57 +0200)
committer
David Herrmann
<dh.herrmann@gmail.com>
Sun, 18 Jan 2015 22:31:11 +0000
(23:31 +0100)
Don't use recvmsg(2) return value to check for too long packets
(it doesn't work) but MSG_TRUNC flag.
(David: add parantheses around condition)
src/libudev/libudev-monitor.c
patch
|
blob
|
history
diff --git
a/src/libudev/libudev-monitor.c
b/src/libudev/libudev-monitor.c
index 484fefeebfe27261167aef5acbf7cb6f26c4f41c..0d361426f7c23c7354cbc9e544ed4a6ff5e54e67 100644
(file)
--- a/
src/libudev/libudev-monitor.c
+++ b/
src/libudev/libudev-monitor.c
@@
-609,7
+609,7
@@
retry:
return NULL;
}
- if (buflen < 32 || (s
ize_t)buflen >= sizeof(buf
)) {
+ if (buflen < 32 || (s
msg.msg_flags & MSG_TRUNC
)) {
log_debug("invalid message length");
return NULL;
}