diff options
author | Ryan Long <ryan.long@oarcorp.com> | 2021-02-16 17:15:01 -0500 |
---|---|---|
committer | Joel Sherrill <joel@rtems.org> | 2021-02-19 14:05:49 -0600 |
commit | 1fd56a96fcfb90ceae5eff2598a5ca375ff85109 (patch) | |
tree | cff3389f27e08fea6982f8e7c9c7016de64afbf2 | |
parent | b1553rt.c: Fix Deference before null check (CID #1399830) (diff) | |
download | rtems-1fd56a96fcfb90ceae5eff2598a5ca375ff85109.tar.bz2 |
grtc.c: Fix Dereference before null check (CID #1399840)
CID 1399840: Dereference before null check in grtc_ioctl().
Closes #4252
-rw-r--r-- | bsps/shared/grlib/tmtc/grtc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bsps/shared/grlib/tmtc/grtc.c b/bsps/shared/grlib/tmtc/grtc.c index 44e9685c3a..e9acea4ddb 100644 --- a/bsps/shared/grlib/tmtc/grtc.c +++ b/bsps/shared/grlib/tmtc/grtc.c @@ -1532,7 +1532,7 @@ static rtems_device_driver grtc_ioctl(rtems_device_major_number major, rtems_dev struct grtc_priv *pDev; struct drvmgr_dev *dev; rtems_libio_ioctl_args_t *ioarg = (rtems_libio_ioctl_args_t *)arg; - unsigned int *data = ioarg->buffer; + unsigned int *data; int status,frm_len,i,ret; struct grtc_ioc_buf_params *buf_arg; struct grtc_ioc_config *cfg; @@ -1556,6 +1556,8 @@ static rtems_device_driver grtc_ioctl(rtems_device_major_number major, rtems_dev if (!ioarg) return RTEMS_INVALID_NAME; + data = ioarg->buffer; + ioarg->ioctl_return = 0; switch(ioarg->command) { case GRTC_IOC_START: |