Re: [PATCH v2] ASoC: dapm: fix out-of-bounds accesses to DAPM lookup tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 04, 2019 at 09:08:41AM -0600, Pierre-Louis Bossart wrote:

> Yes I thought about this but didn't know why the array was declared with an
> implicit length.

It's been that way since the first commit (which predates me) so I don't
think it was a super thought through decision.

> Unfortunately the zero is a legit value today, so we'd have to move all
> existing values by one. Not sure if it's worth it.

It's not hard.

> Maybe an alternate way to fix this is to define snd_soc_dapm_max and check
> if the ARRAY_SIZE of dapm_up_seq and dapm_down_seq match. That would trap
> any changes in the enum that isn't reflected in the _seq look-up tables.

We could do that and another thing together for maximum robustness!

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux