Bug 110697

Summary: bad source code
Product: [Fedora] Fedora Reporter: d.binderman
Component: compat-dbAssignee: Jindrich Novy <jnovy>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: nobody+pnasrat, pknirsch
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-02-14 14:05:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch that clarifies the correct behavior none

Description d.binderman 2003-11-23 16:16:20 UTC
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 14:35:24 UTC
Created attachment 114057 [details]
Patch that clarifies the correct behavior

Comment 2 Jindrich Novy 2006-02-14 14:05:26 UTC
The pointer arithmetics is now clarified since compat-db-4.2.52-4.

Comment 3 Fedora Update System 2006-02-17 19:18:17 UTC
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.