HomeFreeBSD

dtrace: fix an out of bound read and a NULL pointer increment

Description

dtrace: fix an out of bound read and a NULL pointer increment

In dt_cc.c when the provider is an empty string, accessing
strlen(pdp->dtpd_provider) - 1 will result in a pdp->dtpd_provider[-1]
access.

Similarly, in dt_ident.c, if p2 is a NULL pointer, doing a p2++ on it is
undefined behaviour.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Google
Differential Revision: https://reviews.freebsd.org/D30778

Details

Provenance
domagoj.stolfa_gmail.comAuthored on Jun 17 2021, 5:35 PM
markjCommitted on Jun 17 2021, 5:52 PM
Reviewer
markj
Differential Revision
D30778: dtrace: fix an out of bound read and a NULL pointer increment
Parents
R10:0247c33e89ad: amd64 efirt: initialize vm_pages backing EFI runtime memory
Branches
Unknown
Tags
Unknown