Fixed an array bounds violation.

Let include guards comform to the Minix standard.
This commit is contained in:
Kees van Reeuwijk 2010-02-24 10:39:58 +00:00
parent 3922d45719
commit 1ce69592d2
9 changed files with 16 additions and 15 deletions

View file

@ -385,7 +385,7 @@ static void el3_read_StationAddress(dpeth_t * dep)
{
unsigned int ix, rc;
for (ix = EE_3COM_NODE_ADDR; ix < SA_ADDR_LEN;) {
for (ix = EE_3COM_NODE_ADDR; ix < SA_ADDR_LEN+EE_3COM_NODE_ADDR;) {
/* Accesses with word No. */
rc = el3_read_eeprom(dep->de_id_port, ix / 2);
/* Swaps bytes of word */

View file

@ -7,8 +7,8 @@ and 82562 fast ethernet controllers.
Created: Nov 2004 by Philip Homburg <philip@f-mnx.phicoh.com>
*/
#ifndef _INC_FXP_H
#define _INC_FXP_H
#ifndef _FXP_FXP_H
#define _FXP_FXP_H
#define VERBOSE 0 /* display output during intialization */

View file

@ -6,8 +6,8 @@ Created: Nov 2004 by Philip Homburg <philip@f-mnx.phicoh.com>
Definitions for the Media Independent (Ethernet) Interface
*/
#ifndef _INC_MII_H
#define _INC_MII_H
#ifndef _FXP_MII_H
#define _FXP_MII_H
/* Registers in the Machine Independent Interface (MII) to the PHY.
* IEEE 802.3 (2000 Edition) Clause 22.

View file

@ -1,5 +1,5 @@
#ifndef _INC_SYS_TYPE_H
#define _INC_SYS_TYPE_H
#ifndef _INCLUDE_SYS_TYPE_H
#define _INCLUDE_SYS_TYPE_H
/*
* this files resolves conflicts between the file of the host system and

View file

@ -1,5 +1,5 @@
#ifndef _INC_INC_H
#define _INC_INC_H
#ifndef _DS_INC_H
#define _DS_INC_H
/* Header file including all needed system headers. */

View file

@ -1,5 +1,5 @@
#ifndef _INC_PROTO_H
#define _INC_PROTO_H
#ifndef _DS_PROTO_H
#define _DS_PROTO_H
/* Function prototypes. */

View file

@ -553,7 +553,7 @@ PUBLIC int do_subscribe(message *m_ptr)
subp->flags = DSF_IN_USE | type_set;
strcpy(subp->owner, owner);
for(b = 0; b < BITMAP_CHUNKS(NR_DS_SUBS); b++)
for(b = 0; b < BITMAP_CHUNKS(NR_DS_KEYS); b++)
subp->old_subs[b] = 0;
/* See if caller requested an instant initial list. */

View file

@ -997,8 +997,6 @@ icmp_hdr_t *icmp_hdr;
{
int entries;
int entry_size;
u32_t addr;
i32_t pref;
u16_t lifetime;
int i;
char *bufp;
@ -1053,6 +1051,9 @@ icmp_hdr_t *icmp_hdr;
for (i= 0, bufp= (char *)&icmp_hdr->ih_dun.uhd_data[0]; i< entries; i++,
bufp += entry_size)
{
u32_t addr;
i32_t pref;
addr= *(ipaddr_t *)bufp;
pref= ntohl(*(u32_t *)(bufp+4));
ipr_add_oroute(icmp_port->icp_ipport, HTONL(0L), HTONL(0L),

View file

@ -43,7 +43,7 @@ ioreq_t req;
int ent_no, r;
nwio_ipconf_t ipconf_var;
assert (fd>=0 && fd<=IP_FD_NR);
assert (fd>=0 && fd<IP_FD_NR);
ip_fd= &ip_fd_table[fd];
assert (ip_fd->if_flags & IFF_INUSE);