Skip to content

Commit

Permalink
eicon: fix -Warray-bounds warning
Browse files Browse the repository at this point in the history
Fix for a -Warray-bounds warning. mixer_notify_update() tries to
write to ((CAPI_MSG *) msg)->info.facility_req.structs[3] while
structs is defined as byte structs[1]. Set all 'structs' which are
part of the typdefs in the info union to 'byte structs[0]'.

v2: set all info.*.structs to byte structs[0]

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Danny Kukawka authored and David S. Miller committed Feb 2, 2012
1 parent 87e7597 commit e1f4c48
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions drivers/isdn/hardware/eicon/capi20.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ typedef struct api_profile_s {
/*------------------------------------------------------------------*/
/* ALERT-REQUEST */
typedef struct {
byte structs[1]; /* Additional Info */
byte structs[0]; /* Additional Info */
} _ALT_REQP;
/* ALERT-CONFIRM */
typedef struct {
Expand All @@ -126,7 +126,7 @@ typedef struct {
/* CONNECT-REQUEST */
typedef struct {
word CIP_Value;
byte structs[1]; /* Called party number,
byte structs[0]; /* Called party number,
Called party subaddress,
Calling party number,
Calling party subaddress,
Expand All @@ -143,7 +143,7 @@ typedef struct {
/* CONNECT-INDICATION */
typedef struct {
word CIP_Value;
byte structs[1]; /* Called party number,
byte structs[0]; /* Called party number,
Called party subaddress,
Calling party number,
Calling party subaddress,
Expand All @@ -155,24 +155,24 @@ typedef struct {
/* CONNECT-RESPONSE */
typedef struct {
word Accept;
byte structs[1]; /* B_protocol,
byte structs[0]; /* B_protocol,
Connected party number,
Connected party subaddress,
LLC */
} _CON_RESP;
/* CONNECT-ACTIVE-INDICATION */
typedef struct {
byte structs[1]; /* Connected party number,
byte structs[0]; /* Connected party number,
Connected party subaddress,
LLC */
} _CON_A_INDP;
/* CONNECT-ACTIVE-RESPONSE */
typedef struct {
byte structs[1]; /* empty */
byte structs[0]; /* empty */
} _CON_A_RESP;
/* DISCONNECT-REQUEST */
typedef struct {
byte structs[1]; /* Additional Info */
byte structs[0]; /* Additional Info */
} _DIS_REQP;
/* DISCONNECT-CONFIRM */
typedef struct {
Expand All @@ -184,13 +184,13 @@ typedef struct {
} _DIS_INDP;
/* DISCONNECT-RESPONSE */
typedef struct {
byte structs[1]; /* empty */
byte structs[0]; /* empty */
} _DIS_RESP;
/* LISTEN-REQUEST */
typedef struct {
dword Info_Mask;
dword CIP_Mask;
byte structs[1]; /* Calling party number,
byte structs[0]; /* Calling party number,
Calling party subaddress */
} _LIS_REQP;
/* LISTEN-CONFIRM */
Expand All @@ -199,7 +199,7 @@ typedef struct {
} _LIS_CONP;
/* INFO-REQUEST */
typedef struct {
byte structs[1]; /* Called party number,
byte structs[0]; /* Called party number,
Additional Info */
} _INF_REQP;
/* INFO-CONFIRM */
Expand All @@ -209,15 +209,15 @@ typedef struct {
/* INFO-INDICATION */
typedef struct {
word Number;
byte structs[1]; /* Info element */
byte structs[0]; /* Info element */
} _INF_INDP;
/* INFO-RESPONSE */
typedef struct {
byte structs[1]; /* empty */
byte structs[0]; /* empty */
} _INF_RESP;
/* SELECT-B-REQUEST */
typedef struct {
byte structs[1]; /* B-protocol */
byte structs[0]; /* B-protocol */
} _SEL_B_REQP;
/* SELECT-B-CONFIRM */
typedef struct {
Expand All @@ -226,7 +226,7 @@ typedef struct {
/* FACILITY-REQUEST */
typedef struct {
word Selector;
byte structs[1]; /* Facility parameters */
byte structs[0]; /* Facility parameters */
} _FAC_REQP;
/* FACILITY-CONFIRM STRUCT FOR SUPPLEMENT. SERVICES */
typedef struct {
Expand All @@ -240,46 +240,46 @@ typedef struct {
typedef struct {
word Info;
word Selector;
byte structs[1]; /* Facility parameters */
byte structs[0]; /* Facility parameters */
} _FAC_CONP;
/* FACILITY-INDICATION */
typedef struct {
word Selector;
byte structs[1]; /* Facility parameters */
byte structs[0]; /* Facility parameters */
} _FAC_INDP;
/* FACILITY-RESPONSE */
typedef struct {
word Selector;
byte structs[1]; /* Facility parameters */
byte structs[0]; /* Facility parameters */
} _FAC_RESP;
/* CONNECT-B3-REQUEST */
typedef struct {
byte structs[1]; /* NCPI */
byte structs[0]; /* NCPI */
} _CON_B3_REQP;
/* CONNECT-B3-CONFIRM */
typedef struct {
word Info;
} _CON_B3_CONP;
/* CONNECT-B3-INDICATION */
typedef struct {
byte structs[1]; /* NCPI */
byte structs[0]; /* NCPI */
} _CON_B3_INDP;
/* CONNECT-B3-RESPONSE */
typedef struct {
word Accept;
byte structs[1]; /* NCPI */
byte structs[0]; /* NCPI */
} _CON_B3_RESP;
/* CONNECT-B3-ACTIVE-INDICATION */
typedef struct {
byte structs[1]; /* NCPI */
byte structs[0]; /* NCPI */
} _CON_B3_A_INDP;
/* CONNECT-B3-ACTIVE-RESPONSE */
typedef struct {
byte structs[1]; /* empty */
byte structs[0]; /* empty */
} _CON_B3_A_RESP;
/* DISCONNECT-B3-REQUEST */
typedef struct {
byte structs[1]; /* NCPI */
byte structs[0]; /* NCPI */
} _DIS_B3_REQP;
/* DISCONNECT-B3-CONFIRM */
typedef struct {
Expand All @@ -288,11 +288,11 @@ typedef struct {
/* DISCONNECT-B3-INDICATION */
typedef struct {
word Info;
byte structs[1]; /* NCPI */
byte structs[0]; /* NCPI */
} _DIS_B3_INDP;
/* DISCONNECT-B3-RESPONSE */
typedef struct {
byte structs[1]; /* empty */
byte structs[0]; /* empty */
} _DIS_B3_RESP;
/* DATA-B3-REQUEST */
typedef struct {
Expand Down Expand Up @@ -335,28 +335,28 @@ typedef struct {
} _DAT_B3_RESP;
/* RESET-B3-REQUEST */
typedef struct {
byte structs[1]; /* NCPI */
byte structs[0]; /* NCPI */
} _RES_B3_REQP;
/* RESET-B3-CONFIRM */
typedef struct {
word Info;
} _RES_B3_CONP;
/* RESET-B3-INDICATION */
typedef struct {
byte structs[1]; /* NCPI */
byte structs[0]; /* NCPI */
} _RES_B3_INDP;
/* RESET-B3-RESPONSE */
typedef struct {
byte structs[1]; /* empty */
byte structs[0]; /* empty */
} _RES_B3_RESP;
/* CONNECT-B3-T90-ACTIVE-INDICATION */
typedef struct {
byte structs[1]; /* NCPI */
byte structs[0]; /* NCPI */
} _CON_B3_T90_A_INDP;
/* CONNECT-B3-T90-ACTIVE-RESPONSE */
typedef struct {
word Reject;
byte structs[1]; /* NCPI */
byte structs[0]; /* NCPI */
} _CON_B3_T90_A_RESP;
/*------------------------------------------------------------------*/
/* message structure */
Expand Down

0 comments on commit e1f4c48

Please sign in to comment.