Bug 110900

Summary: bad source code
Product: [Fedora] Fedora Reporter: d.binderman
Component: nss_dbAssignee: Nalin Dahyabhai <nalin>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 1   
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-04-21 16:50:53 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:

Description d.binderman 2003-11-25 12:32:42 UTC
Description of problem:

I just tried to compile package nss_db-2_2-22 with  compiler
flag -Wall.

The compiler said

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

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):
nss_db-2_2-22 

How reproducible:


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


Expected results:


Additional info:

Comment 1 David Binderman 2004-11-24 10:17:52 UTC
This code is still broken in Fedoara Core 3, nearly a 
year later.

Comment 2 John Thacker 2006-04-21 16:50:53 UTC
This is only a warning, not an error.  The code works as expected.  There's no
reason to patch upstream code just to fix a warning.