chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bus: when the first char a server receives isn't the NUL byte immediately fail
[elogind.git]
/
src
/
libsystemd-bus
/
bus-socket.c
diff --git
a/src/libsystemd-bus/bus-socket.c
b/src/libsystemd-bus/bus-socket.c
index 30e594243d5d62893182f30d21b1600cc22b84c4..82e683a9578724bd9acd2e5f459afb804ea01734 100644
(file)
--- a/
src/libsystemd-bus/bus-socket.c
+++ b/
src/libsystemd-bus/bus-socket.c
@@
-313,13
+313,16
@@
static int bus_socket_auth_verify_server(sd_bus *b) {
assert(b);
assert(b);
- if (b->rbuffer_size <
3
)
+ if (b->rbuffer_size <
1
)
return 0;
/* First char must be a NUL byte */
if (*(char*) b->rbuffer != 0)
return -EIO;
return 0;
/* First char must be a NUL byte */
if (*(char*) b->rbuffer != 0)
return -EIO;
+ if (b->rbuffer_size < 3)
+ return 0;
+
/* Begin with the first line */
if (b->auth_rbegin <= 0)
b->auth_rbegin = 1;
/* Begin with the first line */
if (b->auth_rbegin <= 0)
b->auth_rbegin = 1;