This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit 707b7be4da2d936cf6395a6dd66a883e86cf89b5
Author: zhanghongyu <zhanghon...@xiaomi.com>
AuthorDate: Wed Apr 27 13:38:21 2022 +0800

    usrsock: ioctl Remove bad copy operations
    
    Signed-off-by: zhanghongyu <zhanghon...@xiaomi.com>
---
 netutils/usrsock_rpmsg/usrsock_rpmsg_server.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/netutils/usrsock_rpmsg/usrsock_rpmsg_server.c 
b/netutils/usrsock_rpmsg/usrsock_rpmsg_server.c
index 0c8407898..13d85b36c 100644
--- a/netutils/usrsock_rpmsg/usrsock_rpmsg_server.c
+++ b/netutils/usrsock_rpmsg/usrsock_rpmsg_server.c
@@ -765,7 +765,7 @@ static int usrsock_rpmsg_ioctl_handler(struct 
rpmsg_endpoint *ept,
 #ifdef CONFIG_NETDEV_WIRELESS_IOCTL
       wlreq = (struct iwreq *)(req + 1);
       wlack = (struct iwreq *)(ack + 1);
-      if (WL_IS80211POINTERCMD(req->cmd))
+      if (WL_IS80211POINTERCMD(req->cmd) && wlreq->u.data.pointer)
         {
           wlack->u.data.pointer = wlack + 1;
         }
@@ -775,7 +775,7 @@ static int usrsock_rpmsg_ioctl_handler(struct 
rpmsg_endpoint *ept,
               req->cmd, (unsigned long)(ack + 1));
 
 #ifdef CONFIG_NETDEV_WIRELESS_IOCTL
-      if (WL_IS80211POINTERCMD(req->cmd))
+      if (WL_IS80211POINTERCMD(req->cmd) && wlreq->u.data.pointer)
         {
           if (ret >= 0)
             {

Reply via email to