* [Xenomai] [PATCH] fix one out-of-bounds access
@ 2018-04-25 13:05 Norbert Lange
2018-04-25 13:05 ` [Xenomai] [PATCH] add missing headers and casts, prefer POSIX definitions Norbert Lange
0 siblings, 1 reply; 3+ messages in thread
From: Norbert Lange @ 2018-04-25 13:05 UTC (permalink / raw)
To: xenomai
Signed-off-by: Norbert Lange <norbert.lange@andritz.com>
---
testsuite/smokey/net_common/smokey_net_server.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testsuite/smokey/net_common/smokey_net_server.c b/testsuite/smokey/net_common/smokey_net_server.c
index a0ed52fd9..2e19208e7 100644
--- a/testsuite/smokey/net_common/smokey_net_server.c
+++ b/testsuite/smokey/net_common/smokey_net_server.c
@@ -89,7 +89,7 @@ rtnet_rtcfg_add_client(int fd, const char *hwaddr, const char *ipaddr)
cmd.args.add.ip_addr = ip.s_addr;
cmd.args.add.timeout = 3000;
memcpy(cmd.args.add.mac_addr, mac.ether_addr_octet,
- sizeof(cmd.args.add.mac_addr));
+ sizeof(mac.ether_addr_octet));
check_unix(ioctl(fd, RTCFG_IOC_ADD, &cmd));
}
--
2.17.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Xenomai] [PATCH] add missing headers and casts, prefer POSIX definitions
2018-04-25 13:05 [Xenomai] [PATCH] fix one out-of-bounds access Norbert Lange
@ 2018-04-25 13:05 ` Norbert Lange
0 siblings, 0 replies; 3+ messages in thread
From: Norbert Lange @ 2018-04-25 13:05 UTC (permalink / raw)
To: xenomai
silences some compiler warnings
Signed-off-by: Norbert Lange <norbert.lange@andritz.com>
---
demo/posix/cobalt/gpiopwm.c | 4 ++--
testsuite/smokey/posix-select/posix-select.c | 3 +++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/demo/posix/cobalt/gpiopwm.c b/demo/posix/cobalt/gpiopwm.c
index b34cbf1e1..eddd5cce5 100644
--- a/demo/posix/cobalt/gpiopwm.c
+++ b/demo/posix/cobalt/gpiopwm.c
@@ -219,7 +219,7 @@ static void *gpiopwm_udp_ctrl_thread(void *cookie)
saddr.sin_port = htons(port);
saddr.sin_family = AF_INET;
- if (bind(sockfd, &saddr, sizeof(saddr)) < 0)
+ if (bind(sockfd, (struct sockaddr *)&saddr, sizeof(saddr)) < 0)
perror("bind");
clen = sizeof(caddr);
@@ -230,7 +230,7 @@ static void *gpiopwm_udp_ctrl_thread(void *cookie)
print_config("UDP Server\n");
memset(buf,'\0', blen);
- ret = recvfrom(sockfd, buf, blen - 1, 0, &caddr, &clen);
+ ret = recvfrom(sockfd, buf, blen - 1, 0, (struct sockaddr *)&caddr, &clen);
if (ret < 0)
perror("recvfrom");
diff --git a/testsuite/smokey/posix-select/posix-select.c b/testsuite/smokey/posix-select/posix-select.c
index 6bd88ddb5..e9bf938b3 100644
--- a/testsuite/smokey/posix-select/posix-select.c
+++ b/testsuite/smokey/posix-select/posix-select.c
@@ -30,6 +30,9 @@
#include <pthread.h>
#include <boilerplate/atomic.h>
#include <sys/select.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
#include <smokey/smokey.h>
smokey_test_plugin(posix_select,
--
2.17.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Xenomai] [PATCH] fix one out-of-bounds access
@ 2018-04-23 14:21 Norbert Lange
0 siblings, 0 replies; 3+ messages in thread
From: Norbert Lange @ 2018-04-23 14:21 UTC (permalink / raw)
To: xenomai
Signed-off-by: Norbert Lange <norbert.lange@andritz.com>
---
testsuite/smokey/net_common/smokey_net_server.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testsuite/smokey/net_common/smokey_net_server.c b/testsuite/smokey/net_common/smokey_net_server.c
index a0ed52fd9..2e19208e7 100644
--- a/testsuite/smokey/net_common/smokey_net_server.c
+++ b/testsuite/smokey/net_common/smokey_net_server.c
@@ -89,7 +89,7 @@ rtnet_rtcfg_add_client(int fd, const char *hwaddr, const char *ipaddr)
cmd.args.add.ip_addr = ip.s_addr;
cmd.args.add.timeout = 3000;
memcpy(cmd.args.add.mac_addr, mac.ether_addr_octet,
- sizeof(cmd.args.add.mac_addr));
+ sizeof(mac.ether_addr_octet));
check_unix(ioctl(fd, RTCFG_IOC_ADD, &cmd));
}
--
2.17.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-04-25 13:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-25 13:05 [Xenomai] [PATCH] fix one out-of-bounds access Norbert Lange
2018-04-25 13:05 ` [Xenomai] [PATCH] add missing headers and casts, prefer POSIX definitions Norbert Lange
-- strict thread matches above, loose matches on Subject: below --
2018-04-23 14:21 [Xenomai] [PATCH] fix one out-of-bounds access Norbert Lange
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.