Bug 110697 - bad source code
bad source code
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: compat-db (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jindrich Novy
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-11-23 11:16 EST by d.binderman
Modified: 2013-07-02 18:58 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-02-14 09:05:26 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)
Patch that clarifies the correct behavior (986 bytes, patch)
2005-05-05 10:35 EDT, Dan Williams
no flags Details | Diff

  None (edit)
Description d.binderman 2003-11-23 11:16:20 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)

Description of problem:
I just tried to compile package compat-db-4_0_14-2 with compiler
flag -Wall.

The compiler said

../db_load/db_load.c:810: warning: operation on `instr' may be 
undefined

The source code file is
compat-db-4.0.14/db-4.0.14/db_load/db_load.c

The source code is

                        c = digitize(dbenv, *instr, &e1) << 4 |
                            digitize(dbenv, *++instr, &e2);

Much better code is

                        c = digitize(dbenv, instr[ 0], &e1) << 4 |
                            digitize(dbenv, instr[ 1], &e2);
                        ++instr;


Version-Release number of selected component (if applicable):
compat-db-4_0_14-2 

How reproducible:
Always

Steps to Reproduce:
1. compile package with compiler flag -Wall.
2.
3.
    

Additional info:
Comment 1 Dan Williams 2005-05-05 10:35:24 EDT
Created attachment 114057 [details]
Patch that clarifies the correct behavior
Comment 2 Jindrich Novy 2006-02-14 09:05:26 EST
The pointer arithmetics is now clarified since compat-db-4.2.52-4.
Comment 3 Fedora Update System 2006-02-17 14:18:17 EST
From User-Agent: XML-RPC

compat-db-4.2.52-2.FC4 has been pushed for FC4, which should resolve this issue.  If these problems are still present in this version, then please make note of it in this bug report.

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