summaryrefslogtreecommitdiffstats
path: root/sys/contrib
diff options
context:
space:
mode:
authorjah <jah@FreeBSD.org>2016-05-20 03:03:04 +0000
committerjah <jah@FreeBSD.org>2016-05-20 03:03:04 +0000
commit09fce610f95b1e08464b46c6bda32df7ba9c5c4a (patch)
tree9c4ee70efee6b7622d4c82d088f1e3e318667470 /sys/contrib
parentb245978b1884863127ad9cf3bf166275bbc6c000 (diff)
downloadFreeBSD-src-09fce610f95b1e08464b46c6bda32df7ba9c5c4a.zip
FreeBSD-src-09fce610f95b1e08464b46c6bda32df7ba9c5c4a.tar.gz
iic_rdwr_data->nmsgs is uint32_t, so limit the allowable number of messages to prevent memory exhaustion and short allocations on 32-bit systems. Since iicrdwr is intended to be a workalike of a Linux i2c-dev call, use the same limit of 42 that Linux uses.
Also check the return value of copyin(9) to prevent unnecessary allocation in the failure case. Submitted by: ngie Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D5155
Diffstat (limited to 'sys/contrib')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud