Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 79637 - bad source code
Summary: bad source code
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: grub
Version: 8.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeremy Katz
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-12-14 10:34 UTC by d.binderman
Modified: 2008-05-01 15:38 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-12-29 06:44:39 UTC


Attachments (Terms of Use)

Description d.binderman 2002-12-14 10:34:01 UTC
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 06:44:39 UTC
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.