Bug 79237 - bad source code
bad source code
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: pilot-link (Show other bugs)
8.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ngo Than
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-12-08 05:49 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-08 05:49:15 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-08 05:49:08 EST
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 15:59:38 EST
The first warning could be ignore.
The rest is fixed in pilot-link-0.11.5-3 or newer. Thanks for your report.

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