Skip to content

Commit

Permalink
Fix zap_sock send/send2 data length check
Browse files Browse the repository at this point in the history
  • Loading branch information
narategithub authored and tom95858 committed Sep 16, 2024
1 parent 9e3caf4 commit 8beef09
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/src/zap/sock/zap_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1810,6 +1810,9 @@ static zap_err_t z_sock_send2(zap_ep_t ep, char *buf, size_t len, void *cb_arg)
struct z_sock_io *io;
zap_err_t zerr;

if (len > ep->z->max_msg)
return ZAP_ERR_LOCAL_LEN;

pthread_mutex_lock(&sep->ep.lock);

if (ep->state != ZAP_EP_CONNECTED) {
Expand Down

0 comments on commit 8beef09

Please sign in to comment.