Bug 111280 - undefined source code & used before set
undefined source code & used before set
Status: CLOSED DUPLICATE of bug 106308
Product: Fedora
Classification: Fedora
Component: timidity++ (Show other bugs)
1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Thomas Woerner
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-12-01 13:29 EST by d.binderman
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-02-21 14:00:14 EST
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 2003-12-01 13:29:21 EST
Description of problem:
I just tried to compile package timidity++-2.11.3-8 from Fedora.

The compiler said

1.

resample.c:990: warning: operation on `dest' may be undefined
resample.c:991: warning: operation on `dest' may be undefined

The source code is

  *dest++ = *(dest - 1) / 2;
  *dest++ = *(dest - 1) / 2;

This source code is undefined. Better source code is

  *dest = *(dest - 1) / 2;
  ++dest;
  *dest = *(dest - 1) / 2;
  ++dest;

2.

playmidi.c(4667): remark #592: variable "rc" is used before its value
is set

The source code is

    int rc;
    static int play_count = 0;

    if (play_mode->id_character == 'm') {
        int cnt;

        convert_mod_to_midi_file(eventlist);

        play_count = 0;
        cnt = free_global_mblock();     /* free unused memory */
        if(cnt > 0)
            ctl->cmsg(CMSG_INFO, VERB_VERBOSE,
                      "%d memory blocks are free", cnt);
        return rc;
    }

Suggest initialise rc before first use.



Version-Release number of selected component (if applicable):
timidity++-2.11.3-8 

How reproducible:


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


Expected results:


Additional info:
Comment 1 Thomas Woerner 2004-04-22 09:28:55 EDT

*** This bug has been marked as a duplicate of 106308 ***
Comment 2 Red Hat Bugzilla 2006-02-21 14:00:14 EST
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.

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