Commit e1f4c485 authored by Danny Kukawka's avatar Danny Kukawka Committed by David S. Miller

eicon: fix -Warray-bounds warning

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: default avatarDanny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 87e7597b
...@@ -117,7 +117,7 @@ typedef struct api_profile_s { ...@@ -117,7 +117,7 @@ typedef struct api_profile_s {
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
/* ALERT-REQUEST */ /* ALERT-REQUEST */
typedef struct { typedef struct {
byte structs[1]; /* Additional Info */ byte structs[0]; /* Additional Info */
} _ALT_REQP; } _ALT_REQP;
/* ALERT-CONFIRM */ /* ALERT-CONFIRM */
typedef struct { typedef struct {
...@@ -126,7 +126,7 @@ typedef struct { ...@@ -126,7 +126,7 @@ typedef struct {
/* CONNECT-REQUEST */ /* CONNECT-REQUEST */
typedef struct { typedef struct {
word CIP_Value; word CIP_Value;
byte structs[1]; /* Called party number, byte structs[0]; /* Called party number,
Called party subaddress, Called party subaddress,
Calling party number, Calling party number,
Calling party subaddress, Calling party subaddress,
...@@ -143,7 +143,7 @@ typedef struct { ...@@ -143,7 +143,7 @@ typedef struct {
/* CONNECT-INDICATION */ /* CONNECT-INDICATION */
typedef struct { typedef struct {
word CIP_Value; word CIP_Value;
byte structs[1]; /* Called party number, byte structs[0]; /* Called party number,
Called party subaddress, Called party subaddress,
Calling party number, Calling party number,
Calling party subaddress, Calling party subaddress,
...@@ -155,24 +155,24 @@ typedef struct { ...@@ -155,24 +155,24 @@ typedef struct {
/* CONNECT-RESPONSE */ /* CONNECT-RESPONSE */
typedef struct { typedef struct {
word Accept; word Accept;
byte structs[1]; /* B_protocol, byte structs[0]; /* B_protocol,
Connected party number, Connected party number,
Connected party subaddress, Connected party subaddress,
LLC */ LLC */
} _CON_RESP; } _CON_RESP;
/* CONNECT-ACTIVE-INDICATION */ /* CONNECT-ACTIVE-INDICATION */
typedef struct { typedef struct {
byte structs[1]; /* Connected party number, byte structs[0]; /* Connected party number,
Connected party subaddress, Connected party subaddress,
LLC */ LLC */
} _CON_A_INDP; } _CON_A_INDP;
/* CONNECT-ACTIVE-RESPONSE */ /* CONNECT-ACTIVE-RESPONSE */
typedef struct { typedef struct {
byte structs[1]; /* empty */ byte structs[0]; /* empty */
} _CON_A_RESP; } _CON_A_RESP;
/* DISCONNECT-REQUEST */ /* DISCONNECT-REQUEST */
typedef struct { typedef struct {
byte structs[1]; /* Additional Info */ byte structs[0]; /* Additional Info */
} _DIS_REQP; } _DIS_REQP;
/* DISCONNECT-CONFIRM */ /* DISCONNECT-CONFIRM */
typedef struct { typedef struct {
...@@ -184,13 +184,13 @@ typedef struct { ...@@ -184,13 +184,13 @@ typedef struct {
} _DIS_INDP; } _DIS_INDP;
/* DISCONNECT-RESPONSE */ /* DISCONNECT-RESPONSE */
typedef struct { typedef struct {
byte structs[1]; /* empty */ byte structs[0]; /* empty */
} _DIS_RESP; } _DIS_RESP;
/* LISTEN-REQUEST */ /* LISTEN-REQUEST */
typedef struct { typedef struct {
dword Info_Mask; dword Info_Mask;
dword CIP_Mask; dword CIP_Mask;
byte structs[1]; /* Calling party number, byte structs[0]; /* Calling party number,
Calling party subaddress */ Calling party subaddress */
} _LIS_REQP; } _LIS_REQP;
/* LISTEN-CONFIRM */ /* LISTEN-CONFIRM */
...@@ -199,7 +199,7 @@ typedef struct { ...@@ -199,7 +199,7 @@ typedef struct {
} _LIS_CONP; } _LIS_CONP;
/* INFO-REQUEST */ /* INFO-REQUEST */
typedef struct { typedef struct {
byte structs[1]; /* Called party number, byte structs[0]; /* Called party number,
Additional Info */ Additional Info */
} _INF_REQP; } _INF_REQP;
/* INFO-CONFIRM */ /* INFO-CONFIRM */
...@@ -209,15 +209,15 @@ typedef struct { ...@@ -209,15 +209,15 @@ typedef struct {
/* INFO-INDICATION */ /* INFO-INDICATION */
typedef struct { typedef struct {
word Number; word Number;
byte structs[1]; /* Info element */ byte structs[0]; /* Info element */
} _INF_INDP; } _INF_INDP;
/* INFO-RESPONSE */ /* INFO-RESPONSE */
typedef struct { typedef struct {
byte structs[1]; /* empty */ byte structs[0]; /* empty */
} _INF_RESP; } _INF_RESP;
/* SELECT-B-REQUEST */ /* SELECT-B-REQUEST */
typedef struct { typedef struct {
byte structs[1]; /* B-protocol */ byte structs[0]; /* B-protocol */
} _SEL_B_REQP; } _SEL_B_REQP;
/* SELECT-B-CONFIRM */ /* SELECT-B-CONFIRM */
typedef struct { typedef struct {
...@@ -226,7 +226,7 @@ typedef struct { ...@@ -226,7 +226,7 @@ typedef struct {
/* FACILITY-REQUEST */ /* FACILITY-REQUEST */
typedef struct { typedef struct {
word Selector; word Selector;
byte structs[1]; /* Facility parameters */ byte structs[0]; /* Facility parameters */
} _FAC_REQP; } _FAC_REQP;
/* FACILITY-CONFIRM STRUCT FOR SUPPLEMENT. SERVICES */ /* FACILITY-CONFIRM STRUCT FOR SUPPLEMENT. SERVICES */
typedef struct { typedef struct {
...@@ -240,21 +240,21 @@ typedef struct { ...@@ -240,21 +240,21 @@ typedef struct {
typedef struct { typedef struct {
word Info; word Info;
word Selector; word Selector;
byte structs[1]; /* Facility parameters */ byte structs[0]; /* Facility parameters */
} _FAC_CONP; } _FAC_CONP;
/* FACILITY-INDICATION */ /* FACILITY-INDICATION */
typedef struct { typedef struct {
word Selector; word Selector;
byte structs[1]; /* Facility parameters */ byte structs[0]; /* Facility parameters */
} _FAC_INDP; } _FAC_INDP;
/* FACILITY-RESPONSE */ /* FACILITY-RESPONSE */
typedef struct { typedef struct {
word Selector; word Selector;
byte structs[1]; /* Facility parameters */ byte structs[0]; /* Facility parameters */
} _FAC_RESP; } _FAC_RESP;
/* CONNECT-B3-REQUEST */ /* CONNECT-B3-REQUEST */
typedef struct { typedef struct {
byte structs[1]; /* NCPI */ byte structs[0]; /* NCPI */
} _CON_B3_REQP; } _CON_B3_REQP;
/* CONNECT-B3-CONFIRM */ /* CONNECT-B3-CONFIRM */
typedef struct { typedef struct {
...@@ -262,24 +262,24 @@ typedef struct { ...@@ -262,24 +262,24 @@ typedef struct {
} _CON_B3_CONP; } _CON_B3_CONP;
/* CONNECT-B3-INDICATION */ /* CONNECT-B3-INDICATION */
typedef struct { typedef struct {
byte structs[1]; /* NCPI */ byte structs[0]; /* NCPI */
} _CON_B3_INDP; } _CON_B3_INDP;
/* CONNECT-B3-RESPONSE */ /* CONNECT-B3-RESPONSE */
typedef struct { typedef struct {
word Accept; word Accept;
byte structs[1]; /* NCPI */ byte structs[0]; /* NCPI */
} _CON_B3_RESP; } _CON_B3_RESP;
/* CONNECT-B3-ACTIVE-INDICATION */ /* CONNECT-B3-ACTIVE-INDICATION */
typedef struct { typedef struct {
byte structs[1]; /* NCPI */ byte structs[0]; /* NCPI */
} _CON_B3_A_INDP; } _CON_B3_A_INDP;
/* CONNECT-B3-ACTIVE-RESPONSE */ /* CONNECT-B3-ACTIVE-RESPONSE */
typedef struct { typedef struct {
byte structs[1]; /* empty */ byte structs[0]; /* empty */
} _CON_B3_A_RESP; } _CON_B3_A_RESP;
/* DISCONNECT-B3-REQUEST */ /* DISCONNECT-B3-REQUEST */
typedef struct { typedef struct {
byte structs[1]; /* NCPI */ byte structs[0]; /* NCPI */
} _DIS_B3_REQP; } _DIS_B3_REQP;
/* DISCONNECT-B3-CONFIRM */ /* DISCONNECT-B3-CONFIRM */
typedef struct { typedef struct {
...@@ -288,11 +288,11 @@ typedef struct { ...@@ -288,11 +288,11 @@ typedef struct {
/* DISCONNECT-B3-INDICATION */ /* DISCONNECT-B3-INDICATION */
typedef struct { typedef struct {
word Info; word Info;
byte structs[1]; /* NCPI */ byte structs[0]; /* NCPI */
} _DIS_B3_INDP; } _DIS_B3_INDP;
/* DISCONNECT-B3-RESPONSE */ /* DISCONNECT-B3-RESPONSE */
typedef struct { typedef struct {
byte structs[1]; /* empty */ byte structs[0]; /* empty */
} _DIS_B3_RESP; } _DIS_B3_RESP;
/* DATA-B3-REQUEST */ /* DATA-B3-REQUEST */
typedef struct { typedef struct {
...@@ -335,7 +335,7 @@ typedef struct { ...@@ -335,7 +335,7 @@ typedef struct {
} _DAT_B3_RESP; } _DAT_B3_RESP;
/* RESET-B3-REQUEST */ /* RESET-B3-REQUEST */
typedef struct { typedef struct {
byte structs[1]; /* NCPI */ byte structs[0]; /* NCPI */
} _RES_B3_REQP; } _RES_B3_REQP;
/* RESET-B3-CONFIRM */ /* RESET-B3-CONFIRM */
typedef struct { typedef struct {
...@@ -343,20 +343,20 @@ typedef struct { ...@@ -343,20 +343,20 @@ typedef struct {
} _RES_B3_CONP; } _RES_B3_CONP;
/* RESET-B3-INDICATION */ /* RESET-B3-INDICATION */
typedef struct { typedef struct {
byte structs[1]; /* NCPI */ byte structs[0]; /* NCPI */
} _RES_B3_INDP; } _RES_B3_INDP;
/* RESET-B3-RESPONSE */ /* RESET-B3-RESPONSE */
typedef struct { typedef struct {
byte structs[1]; /* empty */ byte structs[0]; /* empty */
} _RES_B3_RESP; } _RES_B3_RESP;
/* CONNECT-B3-T90-ACTIVE-INDICATION */ /* CONNECT-B3-T90-ACTIVE-INDICATION */
typedef struct { typedef struct {
byte structs[1]; /* NCPI */ byte structs[0]; /* NCPI */
} _CON_B3_T90_A_INDP; } _CON_B3_T90_A_INDP;
/* CONNECT-B3-T90-ACTIVE-RESPONSE */ /* CONNECT-B3-T90-ACTIVE-RESPONSE */
typedef struct { typedef struct {
word Reject; word Reject;
byte structs[1]; /* NCPI */ byte structs[0]; /* NCPI */
} _CON_B3_T90_A_RESP; } _CON_B3_T90_A_RESP;
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
/* message structure */ /* message structure */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment