Skip to content

Commit 360a824

Browse files
David Henningssontiwai
authored andcommitted
ALSA: hda - Fix static checker warning in patch_hdmi.c
The static checker warning is: sound/pci/hda/patch_hdmi.c:460 hdmi_eld_ctl_get() error: __memcpy() 'eld->eld_buffer' too small (256 vs 512) I have a hard time figuring out if this can ever cause an information leak (I don't think so), but nonetheless it does not hurt to increase the robustness of the code. Fixes: 68e03de ('ALSA: hda - hdmi: Do not expose eld data when eld is invalid') Reported-by: Dan Carpenter <[email protected]> Signed-off-by: David Henningsson <[email protected]> Cc: <[email protected]> # v3.9+ Signed-off-by: Takashi Iwai <[email protected]>
1 parent 094fd3b commit 360a824

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sound/pci/hda/patch_hdmi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,8 @@ static int hdmi_eld_ctl_get(struct snd_kcontrol *kcontrol,
448448
eld = &per_pin->sink_eld;
449449

450450
mutex_lock(&per_pin->lock);
451-
if (eld->eld_size > ARRAY_SIZE(ucontrol->value.bytes.data)) {
451+
if (eld->eld_size > ARRAY_SIZE(ucontrol->value.bytes.data) ||
452+
eld->eld_size > ELD_MAX_SIZE) {
452453
mutex_unlock(&per_pin->lock);
453454
snd_BUG();
454455
return -EINVAL;

0 commit comments

Comments
 (0)