mirror of
https://github.com/systemd/systemd.git
synced 2025-02-23 13:57:33 +03:00
commit
2b8c2fbb2d
@ -22,4 +22,5 @@ static void test_audit_type(void) {
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
test_audit_type();
|
||||
return 0;
|
||||
}
|
||||
|
@ -590,8 +590,7 @@ _public_ int sd_radv_add_prefix(sd_radv *ra, sd_radv_prefix *p, int dynamic) {
|
||||
cur->valid_until = valid_until;
|
||||
cur->preferred_until = preferred_until;
|
||||
|
||||
log_radv("%s prefix %s/%u preferred %s valid %s",
|
||||
cur? "Updated": "Added",
|
||||
log_radv("Updated prefix %s/%u preferred %s valid %s",
|
||||
addr_p, p->opt.prefixlen,
|
||||
format_timespan(time_string_preferred, FORMAT_TIMESPAN_MAX,
|
||||
preferred, USEC_PER_SEC),
|
||||
@ -691,8 +690,7 @@ _public_ int sd_radv_add_route_prefix(sd_radv *ra, sd_radv_route_prefix *p, int
|
||||
if (valid_until == USEC_INFINITY)
|
||||
return -EOVERFLOW;
|
||||
|
||||
log_radv("%s route prefix %s/%u valid %s",
|
||||
cur? "Updated": "Added",
|
||||
log_radv("Updated route prefix %s/%u valid %s",
|
||||
strempty(pretty), p->opt.prefixlen,
|
||||
format_timespan(time_string_valid, FORMAT_TIMESPAN_MAX, valid, USEC_PER_SEC));
|
||||
|
||||
|
@ -87,4 +87,5 @@ int main(int argc, char *argv[]) {
|
||||
test_dhcp_lease_parse_search_domains_no_data();
|
||||
test_dhcp_lease_parse_search_domains_loops();
|
||||
test_dhcp_lease_parse_search_domains_wrong_len();
|
||||
return 0;
|
||||
}
|
||||
|
@ -317,7 +317,7 @@ static void* client1(void *p) {
|
||||
|
||||
finish:
|
||||
if (bus) {
|
||||
_cleanup_(sd_bus_message_unrefp) sd_bus_message *q;
|
||||
_cleanup_(sd_bus_message_unrefp) sd_bus_message *q = NULL;
|
||||
|
||||
r = sd_bus_message_new_method_call(
|
||||
bus,
|
||||
@ -485,7 +485,7 @@ static void* client2(void *p) {
|
||||
|
||||
finish:
|
||||
if (bus) {
|
||||
_cleanup_(sd_bus_message_unrefp) sd_bus_message *q;
|
||||
_cleanup_(sd_bus_message_unrefp) sd_bus_message *q = NULL;
|
||||
|
||||
r = sd_bus_message_new_method_call(
|
||||
bus,
|
||||
|
@ -15,8 +15,7 @@
|
||||
#include "socket-util.h"
|
||||
#include "strv.h"
|
||||
|
||||
#define GET_CONTAINER(m, i) ((i) < (m)->n_containers ? (struct rtattr*)((uint8_t*)(m)->hdr + (m)->containers[i].offset) : NULL)
|
||||
#define PUSH_CONTAINER(m, new) (m)->container_offsets[(m)->n_containers++] = (uint8_t*)(new) - (uint8_t*)(m)->hdr;
|
||||
#define GET_CONTAINER(m, i) ((struct rtattr*)((uint8_t*)(m)->hdr + (m)->containers[i].offset))
|
||||
|
||||
#define RTA_TYPE(rta) ((rta)->rta_type & NLA_TYPE_MASK)
|
||||
#define RTA_FLAGS(rta) ((rta)->rta_type & ~NLA_TYPE_MASK)
|
||||
@ -520,7 +519,8 @@ int sd_netlink_message_open_container(sd_netlink_message *m, unsigned short type
|
||||
|
||||
assert_return(m, -EINVAL);
|
||||
assert_return(!m->sealed, -EPERM);
|
||||
assert_return(m->n_containers < RTNL_CONTAINER_DEPTH, -ERANGE);
|
||||
/* m->containers[m->n_containers + 1] is accessed both in read and write. Prevent access out of bound */
|
||||
assert_return(m->n_containers < (RTNL_CONTAINER_DEPTH - 1), -ERANGE);
|
||||
|
||||
r = message_attribute_has_type(m, &size, type, NETLINK_TYPE_NESTED);
|
||||
if (r < 0) {
|
||||
@ -567,6 +567,7 @@ int sd_netlink_message_open_container_union(sd_netlink_message *m, unsigned shor
|
||||
|
||||
assert_return(m, -EINVAL);
|
||||
assert_return(!m->sealed, -EPERM);
|
||||
assert_return(m->n_containers < (RTNL_CONTAINER_DEPTH - 1), -ERANGE);
|
||||
|
||||
r = type_system_get_type_system_union(m->containers[m->n_containers].type_system, &type_system_union, type);
|
||||
if (r < 0)
|
||||
@ -609,6 +610,7 @@ int sd_netlink_message_open_array(sd_netlink_message *m, uint16_t type) {
|
||||
|
||||
assert_return(m, -EINVAL);
|
||||
assert_return(!m->sealed, -EPERM);
|
||||
assert_return(m->n_containers < (RTNL_CONTAINER_DEPTH - 1), -ERANGE);
|
||||
|
||||
r = add_rtattr(m, type | NLA_F_NESTED, NULL, 0);
|
||||
if (r < 0)
|
||||
@ -1007,7 +1009,7 @@ int sd_netlink_message_enter_container(sd_netlink_message *m, unsigned short typ
|
||||
int r;
|
||||
|
||||
assert_return(m, -EINVAL);
|
||||
assert_return(m->n_containers < RTNL_CONTAINER_DEPTH, -EINVAL);
|
||||
assert_return(m->n_containers < (RTNL_CONTAINER_DEPTH - 1), -EINVAL);
|
||||
|
||||
r = type_system_get_type(m->containers[m->n_containers].type_system,
|
||||
&nl_type,
|
||||
@ -1098,7 +1100,7 @@ int sd_netlink_message_enter_array(sd_netlink_message *m, unsigned short type_id
|
||||
int r;
|
||||
|
||||
assert_return(m, -EINVAL);
|
||||
assert_return(m->n_containers < RTNL_CONTAINER_DEPTH, -EINVAL);
|
||||
assert_return(m->n_containers < (RTNL_CONTAINER_DEPTH - 1), -EINVAL);
|
||||
|
||||
r = netlink_message_read_internal(m, type_id, &container, NULL);
|
||||
if (r < 0)
|
||||
|
@ -128,7 +128,7 @@ static void test_address_get(sd_netlink *rtnl, int ifindex) {
|
||||
}
|
||||
|
||||
static void test_route(sd_netlink *rtnl) {
|
||||
_cleanup_(sd_netlink_message_unrefp) sd_netlink_message *req;
|
||||
_cleanup_(sd_netlink_message_unrefp) sd_netlink_message *req = NULL;
|
||||
struct in_addr addr, addr_data;
|
||||
uint32_t index = 2, u32_data;
|
||||
int r;
|
||||
|
@ -828,7 +828,7 @@ int config_parse_macsec_key_id(
|
||||
|
||||
_cleanup_(macsec_transmit_association_free_or_set_invalidp) TransmitAssociation *a = NULL;
|
||||
_cleanup_(macsec_receive_association_free_or_set_invalidp) ReceiveAssociation *b = NULL;
|
||||
_cleanup_free_ void *p;
|
||||
_cleanup_free_ void *p = NULL;
|
||||
MACsec *s = userdata;
|
||||
uint8_t *dest;
|
||||
size_t l;
|
||||
|
@ -253,4 +253,5 @@ int main(void) {
|
||||
test_network_get(manager, loopback);
|
||||
|
||||
assert_se(manager_rtnl_enumerate_links(manager) >= 0);
|
||||
return 0;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ static ssize_t dnstls_stream_writev(gnutls_transport_ptr_t p, const giovec_t *io
|
||||
}
|
||||
|
||||
int dnstls_stream_connect_tls(DnsStream *stream, DnsServer *server) {
|
||||
_cleanup_(gnutls_deinitp) gnutls_session_t gs;
|
||||
_cleanup_(gnutls_deinitp) gnutls_session_t gs = NULL;
|
||||
int r;
|
||||
|
||||
assert(stream);
|
||||
|
@ -1743,7 +1743,7 @@ int seccomp_restrict_archs(Set *archs) {
|
||||
}
|
||||
|
||||
int parse_syscall_archs(char **l, Set **archs) {
|
||||
_cleanup_set_free_ Set *_archs;
|
||||
_cleanup_set_free_ Set *_archs = NULL;
|
||||
char **s;
|
||||
int r;
|
||||
|
||||
|
@ -3775,6 +3775,8 @@ static int clean_or_freeze_unit(int argc, char *argv[], void *userdata) {
|
||||
method = "FreezeUnit";
|
||||
else if (streq(argv[0], "thaw"))
|
||||
method = "ThawUnit";
|
||||
else
|
||||
assert_not_reached("Unhandled method");
|
||||
|
||||
STRV_FOREACH(name, names) {
|
||||
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
|
||||
|
@ -21,7 +21,7 @@ static void do_fstab_filter_options(const char *opts,
|
||||
|
||||
int r;
|
||||
const char *name;
|
||||
_cleanup_free_ char *value, *filtered;
|
||||
_cleanup_free_ char *value = NULL, *filtered = NULL;
|
||||
|
||||
r = fstab_filter_options(opts, remove, &name, &value, &filtered);
|
||||
log_info("\"%s\" → %d, \"%s\", \"%s\", \"%s\", expected %d, \"%s\", \"%s\", \"%s\"",
|
||||
|
@ -207,7 +207,7 @@ static int link_unsigned_attribute(sd_device *device, const char *attr, unsigned
|
||||
}
|
||||
|
||||
int link_config_load(link_config_ctx *ctx) {
|
||||
_cleanup_strv_free_ char **files;
|
||||
_cleanup_strv_free_ char **files = NULL;
|
||||
char **f;
|
||||
int r;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user