diff --git a/spa/plugins/avb/avb-pcm-sink.c b/spa/plugins/avb/avb-pcm-sink.c index 2c77483e3..6b9e4856c 100644 --- a/spa/plugins/avb/avb-pcm-sink.c +++ b/spa/plugins/avb/avb-pcm-sink.c @@ -557,7 +557,7 @@ impl_node_port_set_param(void *object, { struct state *this = object; struct port *port; - int res; + int res = 0; spa_return_val_if_fail(this != NULL, -EINVAL); diff --git a/spa/plugins/avb/avb-pcm-source.c b/spa/plugins/avb/avb-pcm-source.c index 1fa48dfdb..9811c2431 100644 --- a/spa/plugins/avb/avb-pcm-source.c +++ b/spa/plugins/avb/avb-pcm-source.c @@ -557,7 +557,7 @@ impl_node_port_set_param(void *object, { struct state *this = object; struct port *port; - int res; + int res = 0; spa_return_val_if_fail(this != NULL, -EINVAL); diff --git a/spa/plugins/v4l2/v4l2-source.c b/spa/plugins/v4l2/v4l2-source.c index 413670eac..b79015a28 100644 --- a/spa/plugins/v4l2/v4l2-source.c +++ b/spa/plugins/v4l2/v4l2-source.c @@ -715,7 +715,7 @@ static int impl_node_port_set_param(void *object, uint32_t id, uint32_t flags, const struct spa_pod *param) { - int res; + int res = 0; struct impl *this = object; struct port *port; diff --git a/src/modules/module-netjack2-driver.c b/src/modules/module-netjack2-driver.c index 88e6f84c2..eccc08f2e 100644 --- a/src/modules/module-netjack2-driver.c +++ b/src/modules/module-netjack2-driver.c @@ -920,7 +920,7 @@ on_socket_io(void *data, int fd, uint32_t mask) if (len < (int)sizeof(struct nj2_session_params)) goto short_packet; - if (strcmp(params.type, "params") != 0) + if (strncmp(params.type, "params", sizeof(params.type)) != 0) goto wrong_type; switch(ntohl(params.packet_id)) { diff --git a/src/modules/module-netjack2-manager.c b/src/modules/module-netjack2-manager.c index 3afe6a888..31310ca0b 100644 --- a/src/modules/module-netjack2-manager.c +++ b/src/modules/module-netjack2-manager.c @@ -434,7 +434,7 @@ on_setup_io(void *data, int fd, uint32_t mask) if (len < (int)sizeof(params)) goto short_packet; - if (strcmp(params.type, "params") != 0) + if (strncmp(params.type, "params", sizeof(params.type)) != 0) goto wrong_type; switch(ntohl(params.packet_id)) { @@ -1072,7 +1072,7 @@ on_socket_io(void *data, int fd, uint32_t mask) if (len < (int)sizeof(params)) goto short_packet; - if (strcmp(params.type, "params") != 0) + if (strncmp(params.type, "params", sizeof(params.type)) != 0) goto wrong_type; switch(ntohl(params.packet_id)) { diff --git a/src/modules/module-netjack2/packets.h b/src/modules/module-netjack2/packets.h index 4943e941a..af60a6c78 100644 --- a/src/modules/module-netjack2/packets.h +++ b/src/modules/module-netjack2/packets.h @@ -110,7 +110,7 @@ static inline void nj2_session_params_hton(struct nj2_session_params *net, } struct nj2_packet_header { - char type[8]; /* packet type ('headr') */ + char type[8]; /* packet type ('header') */ uint32_t data_type; /* 'a' for audio, 'm' for midi and 's' for sync */ uint32_t data_stream; /* 's' for send, 'r' for return */ uint32_t id; /* unique ID of the follower */ diff --git a/src/modules/module-netjack2/peer.c b/src/modules/module-netjack2/peer.c index 5ad4bd7f7..9417323a1 100644 --- a/src/modules/module-netjack2/peer.c +++ b/src/modules/module-netjack2/peer.c @@ -663,7 +663,7 @@ static inline int32_t netjack2_driver_sync_wait(struct netjack2_peer *peer) if (len >= (ssize_t)sizeof(sync)) { //nj2_dump_packet_header(&sync); - if (strcmp(sync.type, "header") == 0 && + if (strncmp(sync.type, "header", sizeof(sync.type)) == 0 && ntohl(sync.data_type) == 's' && ntohl(sync.data_stream) == peer->other_stream && ntohl(sync.id) == peer->params.id) @@ -695,7 +695,7 @@ static inline int32_t netjack2_manager_sync_wait(struct netjack2_peer *peer) if (len >= (ssize_t)sizeof(sync)) { //nj2_dump_packet_header(sync); - if (strcmp(sync.type, "header") == 0 && + if (strncmp(sync.type, "header", sizeof(sync.type)) == 0 && ntohl(sync.data_type) == 's' && ntohl(sync.data_stream) == peer->other_stream && ntohl(sync.id) == peer->params.id)