diff options
Diffstat (limited to 'nuttx/net/uip/uip-send.c')
-rw-r--r-- | nuttx/net/uip/uip-send.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/nuttx/net/uip/uip-send.c b/nuttx/net/uip/uip-send.c index 93096168a..c9899db9e 100644 --- a/nuttx/net/uip/uip-send.c +++ b/nuttx/net/uip/uip-send.c @@ -93,9 +93,13 @@ void uip_send(struct uip_driver_s *dev, const void *buf, int len) { + /* Some sanity checks -- note that the actually available length in the + * buffer is considerably less than CONFIG_NET_BUFSIZE. + */ + if (dev && len > 0 && len < CONFIG_NET_BUFSIZE) { + memcpy(dev->d_snddata, buf, len); dev->d_sndlen = len; - memcpy(dev->d_snddata, buf, len ); - } + } } |