Page MenuHomeFreeBSD

sound: Add min_rate and min_channels safety check in SNDCTL_AUDIOINFO
ClosedPublic

Authored by christos on Jul 5 2024, 2:23 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Aug 12, 8:27 PM
Unknown Object (File)
Tue, Aug 11, 11:20 AM
Unknown Object (File)
Sun, Aug 9, 8:00 PM
Unknown Object (File)
Sat, Aug 8, 1:47 PM
Unknown Object (File)
Sat, Aug 8, 5:14 AM
Unknown Object (File)
Fri, Aug 7, 7:39 PM
Unknown Object (File)
Fri, Aug 7, 8:03 AM
Unknown Object (File)
Thu, Aug 6, 5:42 AM
Subscribers

Details

Summary

If the channel list is empty, min_rate and min_channels will be INT_MAX.
Instead, assign them to 0, like we do in sndstat_get_caps().

Sponsored by: The FreeBSD Foundation
MFC after: 2 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

@dev_submerge.ch I didn't add the same check in dsp_oss_engineinfo() because it will return EINVAL right away if no channel is found, and even if we find it, I don't think it's possible that caps->fmlist can be empty.

This revision is now accepted and ready to land.Jul 5 2024, 6:54 PM