Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 80765 - broken source code
Summary: broken source code
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: pilot-link
Version: 8.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Than Ngo
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-12-30 23:58 UTC by d.binderman
Modified: 2007-04-18 16:49 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-06-30 10:56:32 UTC


Attachments (Terms of Use)

Description d.binderman 2002-12-30 23:58:05 UTC
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 Than Ngo 2003-05-13 14:33:57 UTC
it's not a bug.

Comment 2 d.binderman 2003-07-05 08:14:36 UTC
>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 Than Ngo 2003-07-09 09:27:16 UTC
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 Than Ngo 2004-06-30 10:56:32 UTC
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.