mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-20 11:11:24 +00:00
Fix an unsafe malloc usage with sbufs.
Reported by: ken Sponsored by: Netflix
This commit is contained in:
parent
e83177fba8
commit
da0d7209e0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=317726
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user