diff options
author | Scott Long <scottl@FreeBSD.org> | 2017-05-03 05:33:15 +0000 |
---|---|---|
committer | Scott Long <scottl@FreeBSD.org> | 2017-05-03 05:33:15 +0000 |
commit | da0d7209e07e08ae4bda9bd7af744e20941b58b1 (patch) | |
tree | cf8a46df35441e3cb87d6fcf9fadeb20af7bef15 /sys/cam/cam_periph.c | |
parent | e83177fba8bc71870137889704711cd2c6e44511 (diff) | |
download | src-da0d7209e07e08ae4bda9bd7af744e20941b58b1.tar.gz src-da0d7209e07e08ae4bda9bd7af744e20941b58b1.zip |
Fix an unsafe malloc usage with sbufs.
Reported by: ken
Sponsored by: Netflix
Notes
Notes:
svn path=/head/; revision=317726
Diffstat (limited to 'sys/cam/cam_periph.c')
-rw-r--r-- | sys/cam/cam_periph.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 57acd907d662..bfc98024bd50 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -643,8 +643,9 @@ cam_periph_invalidate(struct cam_periph *periph) CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph invalidated\n")); if ((periph->flags & CAM_PERIPH_ANNOUNCED) && !rebooting) { struct sbuf sb; + char buffer[160]; - sbuf_new(&sb, NULL, 160, SBUF_FIXEDLEN); + sbuf_new(&sb, buffer, 160, SBUF_FIXEDLEN); xpt_denounce_periph_sbuf(periph, &sb); sbuf_finish(&sb); sbuf_putbuf(&sb); |