Bug 140827 - four compile time detectable bugs
four compile time detectable bugs
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: quagga (Show other bugs)
3
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jay Fenlason
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-11-25 04:35 EST by David Binderman
Modified: 2014-08-31 19:26 EDT (History)
1 user (show)

See Also:
Fixed In Version: quagga-0.97.3-1.FC3
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-12-06 14:01:58 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 David Binderman 2004-11-25 04:35:56 EST
Description of problem:

I just tried to compile package quagga-0.97.0-1 from 
Redhat Fedora Core 3.

The compiler said

1.

thread.c(537): remark #592: variable "trel" is used before its value
is set

The source code is

{
  struct timeval trel;

  assert (m != NULL);

  trel.tv_sec += timer;

Seems a bit pointless to add on to something that hasn't been initialised.
Suggest

  struct timeval trel;

  memset( &trel, 0, sizeof( trel));

2.

thread.c(555): remark #592: variable "trel" is used before its value
is set

Duplicate.

3.

sockopt.c(49): warning #1011: missing return statement at end of
non-void function "getsockopt_cmsg_data"

The source code is

  for (cmsg = CMSG_FIRSTHDR(msgh);
       cmsg != NULL;
       cmsg = CMSG_NXTHDR(msgh, cmsg))
    if (cmsg->cmsg_level == level && cmsg->cmsg_type)
      return (ptr = CMSG_DATA(cmsg));
}

What happens if none of the if statements are true - rubbish is returned
to the caller. Suggest add return statement at the end of the routine.

4.

ospf_dump.c(617): remark #592: variable "length" is used before its
value is set
ospf_dump.c(619): remark #592: variable "offset" is used before its
value is set

The source code is

  zlog_info ("ip_len %d", length);
  zlog_info ("ip_id %u", (u_int32_t) iph->ip_id);
  zlog_info ("ip_off %u", (u_int32_t) offset);

Suggest init local variables before first use.



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


How reproducible:


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


Expected results:


Additional info:

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