fix one out-of-bounds access
PATCH 1/1 fix one out-of-bounds access
Signed-off-by Norbert Lange <[email protected]>
--- testsuite/smokey/net_common/smokey_net_server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testsuite/smokey/net_common/smokey_net_server.c +1 -1
@@ -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)); }
Signature · 1 line
2.17.0
PATCH 1/1 add missing headers and casts, prefer POSIX definitions
silences some compiler warnings
Signed-off-by Norbert Lange <[email protected]>
--- demo/posix/cobalt/gpiopwm.c | 4 ++-- testsuite/smokey/posix-select/posix-select.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-)
demo/posix/cobalt/gpiopwm.c +2 -2
@@ -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" );
testsuite/smokey/posix-select/posix-select.c +3 -0
@@ -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,
Signature · 1 line
2.17.0