Bug 79637 - bad source code
bad source code
Status: CLOSED UPSTREAM
Product: Red Hat Linux
Classification: Retired
Component: grub (Show other bugs)
8.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeremy Katz
: MoveUpstream
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-12-14 05:34 EST by d.binderman
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-12-29 01:44:39 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 2002-12-14 05:34:01 EST
Description of problem:

Hello there,

I just tried to compile package grub-0.92-7 from Redhat 8.0.

Here are some of the compiler messages.

fsys_ext2fs.c:494: warning: `str_chk' might be used uninitialized in this function
fsys_minix.c:303: warning: `str_chk' might be used uninitialized in this function
fsys_reiserfs.c:761: warning: operation on `depth' may be undefined

Here is an untested patch which shuts up the compiler.

*** ./stage2/fsys_ext2fs.c.old	2002-11-27 09:10:14.000000000 +0000
--- ./stage2/fsys_ext2fs.c	2002-11-27 09:10:36.000000000 +0000
***************
*** 491,497 ****
    int group_desc;		/* fs pointer to that group */
    int desc;			/* index within that group */
    int ino_blk;			/* fs pointer of the inode's information */
!   int str_chk;			/* used to hold the results of a string compare */
    struct ext2_group_desc *gdp;
    struct ext2_inode *raw_inode;	/* inode info corresponding to current_ino */
  
--- 491,497 ----
    int group_desc;		/* fs pointer to that group */
    int desc;			/* index within that group */
    int ino_blk;			/* fs pointer of the inode's information */
!   int str_chk = 0;			/* used to hold the results of a string compare */
    struct ext2_group_desc *gdp;
    struct ext2_inode *raw_inode;	/* inode info corresponding to current_ino */
  
*** ./stage2/fsys_minix.c.old	2002-11-27 09:10:56.000000000 +0000
--- ./stage2/fsys_minix.c	2002-11-27 09:11:20.000000000 +0000
***************
*** 300,306 ****
    int updir_ino = current_ino;	     /* the parent of the current directory */
    int ino_blk;			     /* fs pointer of the inode's info */
  
!   int str_chk;			     /* used ot hold the results of a string
  				        compare */
  
    struct minix_inode * raw_inode;    /* inode info for current_ino */
--- 300,306 ----
    int updir_ino = current_ino;	     /* the parent of the current directory */
    int ino_blk;			     /* fs pointer of the inode's info */
  
!   int str_chk = 0;		     /* used to hold the results of a string
  				        compare */
  
    struct minix_inode * raw_inode;    /* inode info for current_ino */
*** ./stage2/fsys_reiserfs.c.old	2002-11-27 09:11:38.000000000 +0000
--- ./stage2/fsys_reiserfs.c	2002-11-27 09:14:01.000000000 +0000
***************
*** 758,764 ****
  	cache = CACHE (depth);
        else 
  	{
! 	  cache = read_tree_node (INFO->blocks[depth], --depth);
  	  if (! cache)
  	    return 0;
  	}
--- 758,765 ----
  	cache = CACHE (depth);
        else 
  	{
! 	  cache = read_tree_node (INFO->blocks[depth], (depth - 1));
!           --depth;
  	  if (! cache)
  	    return 0;
  	}


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


How reproducible:


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


Expected results:


Additional info:
Comment 1 Jeremy Katz 2002-12-29 01:44:39 EST
Filed upstream as http://bugcomm.enbug.org/?mode=browse;project=grub;bug_id=15

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