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 79237

Summary: bad source code
Product: [Retired] Red Hat Linux Reporter: d.binderman
Component: pilot-linkAssignee: Ngo Than <than>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0   
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: 2002-12-08 10:49:15 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description d.binderman 2002-12-08 10:49:08 UTC
Description of Problem:

Hello there,

I just tried to compile package pilot-link-0.11.3-3 from Redhat 8.0.

Here are some of the compiler messages.

pilot-datebook-longtxt.c:2184: warning: too few arguments for format
install-datebook.c:242: warning: too few arguments for format
pilot-xfer.c:307: warning: `totalsize' might be used uninitialized in this function
pilot-xfer.c:835: warning: `totalsize' might be used uninitialized in this function

For the first warning, text string LONGTXT_HEADER_CATEGORY_ROW_FORMAT
has five % specifiers, but only four variables are provided in the
sscanf parameter list. I do not know what the fix for this might be.

For the second warning, the offending source code is

                        printf("Description: %s, %s, %s\n",
                                appointment.description);
 
Clearly, three strings are printed, but only one string is supplied.
This will certainly go wrong at run time.

Here is a patch which fixes the last two messages.

*** ./src/pilot-xfer.c.old	2002-11-19 12:25:36.000000000 +0000
--- ./src/pilot-xfer.c	2002-11-19 12:25:55.000000000 +0000
***************
*** 304,310 ****
  	int 	i,
  		ofile_len,
  		ofile_total,
! 		totalsize;
  
  	struct 	dirent *dirent;
  	struct 	stat sbuf;
--- 304,310 ----
  	int 	i,
  		ofile_len,
  		ofile_total,
! 		totalsize = 0;
  
  	struct 	dirent *dirent;
  	struct 	stat sbuf;
***************
*** 832,838 ****
   ***********************************************************************/
  static void Install(char *filename)
  {
! 	int totalsize;
  
  	struct 	pi_file *f;
  	struct 	stat sbuf;
--- 832,838 ----
   ***********************************************************************/
  static void Install(char *filename)
  {
! 	int totalsize = 0;
  
  	struct 	pi_file *f;
  	struct 	stat sbuf;
  


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


How Reproducible:


Steps to Reproduce:
1. 
2. 
3. 

Actual Results:


Expected Results:


Additional Information:

Comment 1 Ngo Than 2002-12-08 20:59:38 UTC
The first warning could be ignore.
The rest is fixed in pilot-link-0.11.5-3 or newer. Thanks for your report.