diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-05-14 11:30:59 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-05-14 11:32:41 +0200 |
commit | 6e6c21c894904d5d9ce75f1a56e4fa5f82b199c1 (patch) | |
tree | a8b10465bce587a3369eb5459f6b776a7456bcb6 /src/libsystemd/sd-bus | |
parent | aeb24f3081ad4971a82d90a9dac4cbe8da3bb228 (diff) |
util: introduce memmem_safe() and make use of it
GNU memmem() requires a nonnull first parameter. Let's introduce
memmem_safe() that removes this restriction for zero-length parameters,
and make use of it where appropriate.
http://lists.freedesktop.org/archives/systemd-devel/2015-May/031705.html
Diffstat (limited to 'src/libsystemd/sd-bus')
-rw-r--r-- | src/libsystemd/sd-bus/bus-socket.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd/sd-bus/bus-socket.c b/src/libsystemd/sd-bus/bus-socket.c index 94a5c04c8b..24b9c4d117 100644 --- a/src/libsystemd/sd-bus/bus-socket.c +++ b/src/libsystemd/sd-bus/bus-socket.c @@ -177,7 +177,7 @@ static int bus_socket_auth_verify_client(sd_bus *b) { /* We expect two response lines: "OK" and possibly * "AGREE_UNIX_FD" */ - e = memmem(b->rbuffer, b->rbuffer_size, "\r\n", 2); + e = memmem_safe(b->rbuffer, b->rbuffer_size, "\r\n", 2); if (!e) return 0; |