mirror of
https://github.com/opnsense/src.git
synced 2026-05-04 17:05:14 -04:00
Check the return value of sbuf_finish() in pfs_readlink() and return
ENAMETOOLONG if the buffer overflowed. Approved by: des MFC after: 2 weeks
This commit is contained in:
parent
ff23e401a5
commit
9cb24e3c98
1 changed files with 5 additions and 1 deletions
|
|
@ -891,7 +891,11 @@ pfs_readlink(struct vop_readlink_args *va)
|
|||
PFS_RETURN (error);
|
||||
}
|
||||
|
||||
sbuf_finish(&sb);
|
||||
if (sbuf_finish(&sb) != 0) {
|
||||
sbuf_delete(&sb);
|
||||
PFS_RETURN (ENAMETOOLONG);
|
||||
}
|
||||
|
||||
error = uiomove_frombuf(sbuf_data(&sb), sbuf_len(&sb), uio);
|
||||
sbuf_delete(&sb);
|
||||
PFS_RETURN (error);
|
||||
|
|
|
|||
Loading…
Reference in a new issue