Page MenuHomeFreeBSD

sound: Do not cast return value of malloc(9)
ClosedPublic

Authored by christos on Sep 29 2024, 12:50 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Aug 10, 6:15 PM
Unknown Object (File)
Mon, Aug 10, 6:15 PM
Unknown Object (File)
Mon, Aug 10, 6:14 PM
Unknown Object (File)
Sun, Aug 9, 12:23 AM
Unknown Object (File)
Sat, Aug 8, 10:27 AM
Unknown Object (File)
Sat, Aug 8, 6:10 AM
Unknown Object (File)
Fri, Aug 7, 12:22 PM
Unknown Object (File)
Wed, Aug 5, 10:12 PM
Subscribers

Details

Summary

No functional change intended.

Sponsored by: The FreeBSD Foundation
MFC after: 2 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 59651
Build 56538: arc lint + arc unit

Event Timeline

zlei added a subscriber: zlei.

Looks good to me.

This revision is now accepted and ready to land.Sep 29 2024, 2:31 PM
markj added inline comments.
sys/dev/sound/pci/hda/hdaa.c
3036

JFYI: we also have mallocarray(), which is nice when one of the parameters is untrusted. A naive multiplication can overflow and result in allocating less memory than expected, which can result in security vulnerabilities in the worst case. mallocarray() will panic in this case instead.

I don't think it matters here, just thought I'd mention it.

sys/dev/sound/pci/spicds.c
147