dbus-socket: move truncation check to bus_socket_set_transient_property()

This commit is contained in:
Yu Watanabe
2017-12-23 19:32:23 +09:00
parent e045e325df
commit b48e508db3
2 changed files with 7 additions and 4 deletions
+3
View File
@@ -381,6 +381,9 @@ static int bus_socket_set_transient_property(
if (r < 0)
return r;
if ((uint64_t) (size_t) t != t)
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid %s: %" PRIu64, name, t);
if (!UNIT_WRITE_FLAGS_NOOP(flags)) {
if (streq(name, "ReceiveBuffer"))
s->receive_buffer = t;