diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-12-09 01:09:21 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-12-09 01:09:21 +0100 |
commit | 3072eecf3c714e3ed88c882623c40aca15445f64 (patch) | |
tree | 4c8a36968ea19888a9ef95f061d7117decf54f79 /src/libsystemd | |
parent | 4a02e68602be9f6f3caac0f6195672490f715fe1 (diff) |
sd-rtnl: fix size check in sd_rtnl_message_append_string()
Diffstat (limited to 'src/libsystemd')
-rw-r--r-- | src/libsystemd/sd-rtnl/rtnl-message.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c index 5c627f96ab..165e84d7a0 100644 --- a/src/libsystemd/sd-rtnl/rtnl-message.c +++ b/src/libsystemd/sd-rtnl/rtnl-message.c @@ -700,8 +700,8 @@ int sd_rtnl_message_append_string(sd_rtnl_message *m, unsigned short type, const size = (size_t)r; if (size) { - length = strnlen(data, size); - if (length >= size) + length = strnlen(data, size+1); + if (length > size) return -EINVAL; } else length = strlen(data); |