Date: Wed, 12 Feb 2025 15:34:22 GMT From: Jose Luis Duran <jlduran@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 4b77a9a80cf8 - main - uath: Avoid a NULL dereference Message-ID: <202502121534.51CFYMaf010529@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=4b77a9a80cf8a9cba5607d8d8fa0742334dcf0f4 commit 4b77a9a80cf8a9cba5607d8d8fa0742334dcf0f4 Author: Jose Luis Duran <jlduran@FreeBSD.org> AuthorDate: 2025-02-12 15:31:43 +0000 Commit: Jose Luis Duran <jlduran@FreeBSD.org> CommitDate: 2025-02-12 15:33:26 +0000 uath: Avoid a NULL dereference PR: 284643 Reviewed by: adrian Approved by: emaste (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D48948 --- sys/dev/usb/wlan/if_uath.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/dev/usb/wlan/if_uath.c b/sys/dev/usb/wlan/if_uath.c index 32e3c0325c6e..10e3b50eaeb3 100644 --- a/sys/dev/usb/wlan/if_uath.c +++ b/sys/dev/usb/wlan/if_uath.c @@ -2308,10 +2308,12 @@ uath_cmdeof(struct uath_softc *sc, struct uath_cmd *cmd) __func__, dlen, sizeof(uint32_t)); return; } - /* XXX have submitter do this */ - /* copy answer into caller's supplied buffer */ - bcopy(hdr+1, cmd->odata, sizeof(uint32_t)); - cmd->olen = sizeof(uint32_t); + if (cmd->odata != NULL) { + /* XXX have submitter do this */ + /* copy answer into caller's supplied buffer */ + bcopy(hdr+1, cmd->odata, sizeof(uint32_t)); + cmd->olen = sizeof(uint32_t); + } wakeup_one(cmd); /* wake up caller */ break;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202502121534.51CFYMaf010529>