Bug 120973 - nested assignments in asserts + subscripts out of range
nested assignments in asserts + subscripts out of range
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: alsa-lib (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-04-15 15:57 EDT by d.binderman
Modified: 2014-03-16 22:44 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-04-19 16:13:45 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description d.binderman 2004-04-15 15:57:07 EDT
Description of problem:

I just tried to compile Core2 Test2 package alsa-lib-1.0.3a-1

The compiler said

1.

pcm.c(754): warning #175: subscript out of range

The source code is

       
snd_interval_set_value(&params->intervals[SND_PCM_HW_PARAM_PERIOD_SIZE],
pcm->period_size);

but

        struct sndrv_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL -
                                       
SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1];

I make it that the array has 12 elements, and the source code asks
for element #13.

2.

pcm.c(755): warning #175: subscript out of range
pcm.c(756): warning #175: subscript out of range
pcm.c(757): warning #175: subscript out of range
pcm.c(758): warning #175: subscript out of range
pcm.c(759): warning #175: subscript out of range

Duplicates.

3.

iwffff.c(644): warning #175: subscript out of range

The source code is

    gwave->share_id[4] = snd_LE_to_host_32(*(((unsigned int *)wave) +
8/4));

but 

	unsigned int share_id[4];

4.

iwffff.c(880): warning #175: subscript out of range
iwffff.c(880): warning #175: subscript out of range

Duplicates.

5. 

More deeply, I checked for nested assigments in assert statements. I found

[dcb@localhost BUILD]$ find . -name \*.c -print | xargs grep -n
"assert.*(.* = "
./alsa-lib-1.0.3a/src/pcm/pcm.c:1799:   assert(handler->type =
SND_ASYNC_HANDLER_PCM);
./alsa-lib-1.0.3a/src/async.c:56:       assert(siginfo->si_code =
SI_SIGIO);
./alsa-lib-1.0.3a/src/control/control.c:539:    assert(handler->type =
SND_ASYNC_HANDLER_CTL);

I'm not saying this is certainly wrong code, I'm only saying it is IMHO
deeply suspicious code.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Bill Nottingham 2004-04-19 16:13:45 EDT
Please file upstream at:
  https://bugtrack.alsa-project.org/alsa-bug/login_page.php

Thanks!
Comment 2 d.binderman 2004-04-19 17:41:20 EDT
>Please file upstream at:

Sorry, but I am unable to.

If you were to help me out here by submitting it,
on my behalf, then that would be ok with me.


Note You need to log in before you can comment on or make changes to this bug.