This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 80765 - broken source code
broken 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-30 18:58 EST by d.binderman
Modified: 2007-04-18 12:49 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-06-30 06:56:32 EDT
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-30 18:58:05 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.6 [en-gb]C-CCK-MCD NetscapeOnline.co.uk  (Win98; I)

Description of problem:

Hello there,

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

Here are some of the messages the compiler produces

cc: Info: pilot-datebook-data.c, line 1263: In this statement, an array is being accessed outside the bounds specified for the array type. 
(subscrbounds)
cc: Info: pilot-datebook-windat.c, line 1152: In this statement, an array is being accessed outside the bounds specified for the array type. 
(subscrbounds)

Here is an untested patch to shut up the compiler.


./src/pilot-datebook/pilot-datebook-data.c.old ./src/pilot-datebook/pilot-datebook-data.c
*** ./src/pilot-datebook/pilot-datebook-data.c.old	Tue Dec 24 20:32:22 2002
--- ./src/pilot-datebook/pilot-datebook-data.c	Tue Dec 24 20:33:43 2002
***************
*** 1259,1266 ****
  	buffer[value_end - value_start] = '\0';
        }
        else {
! 	text_unquote(value_start, buffer, sizeof(buffer));
! 	buffer[sizeof(buffer)] = '\0';
        }
        value->type = DATEBOOK_FIELD_STR;
        value->literal.lit_str = strdup(buffer);
--- 1259,1266 ----
  	buffer[value_end - value_start] = '\0';
        }
        else {
! 	text_unquote(value_start, buffer, sizeof(buffer) - 1);
! 	buffer[sizeof(buffer) - 1] = '\0';
        }
        value->type = DATEBOOK_FIELD_STR;
        value->literal.lit_str = strdup(buffer);
./src/pilot-datebook/pilot-datebook-windat.c.old ./src/pilot-datebook/pilot-datebook-windat.c
*** ./src/pilot-datebook/pilot-datebook-windat.c.old	Tue Dec 24 20:34:08 2002
--- ./src/pilot-datebook/pilot-datebook-windat.c	Tue Dec 24 20:35:56 2002
***************
*** 1149,1155 ****
  				"Unfiled",
  				sizeof(header->aai.category.name) - 1);
  			header->aai.category.
! 			    name[0][sizeof(header->aai.category.name) -
  				    1] = '\0';
  			header->aai.category.ID[0] = 0;
  
--- 1149,1155 ----
  				"Unfiled",
  				sizeof(header->aai.category.name) - 1);
  			header->aai.category.
! 			    name[0][sizeof(header->aai.category.name[ 0]) -
  				    1] = '\0';
  			header->aai.category.ID[0] = 0;
  


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


How reproducible:
Always

Steps to Reproduce:
1. compile with any C compiler that checks array indices at compile time,
for example compaq.
2.
3.
    

Additional info:
Comment 1 Ngo Than 2003-05-13 10:33:57 EDT
it's not a bug.
Comment 2 d.binderman 2003-07-05 04:14:36 EDT
>it's not a bug.

You seem to be new to C programming.

Have a look at page 22 of Kernighan & Ritchie Second edition.

It's a bug. I think so, the C compiler thinks so.
Comment 3 Ngo Than 2003-07-09 05:27:16 EDT
Oh, i have closed the wrong bug here, cut and paste problem :-( 

Of course it's a bug, which should be fixed. Thanks your info again.
Comment 4 Ngo Than 2004-06-30 06:56:32 EDT
it's fixed in pilot-link-0.11.8-6. Thanks for your report.

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