|
@@ -153,8 +153,12 @@ __u16 sctp_ulpevent_get_notification_type(const struct sctp_ulpevent *event);
|
|
static inline int sctp_ulpevent_type_enabled(__u16 sn_type,
|
|
static inline int sctp_ulpevent_type_enabled(__u16 sn_type,
|
|
struct sctp_event_subscribe *mask)
|
|
struct sctp_event_subscribe *mask)
|
|
{
|
|
{
|
|
|
|
+ int offset = sn_type - SCTP_SN_TYPE_BASE;
|
|
char *amask = (char *) mask;
|
|
char *amask = (char *) mask;
|
|
- return amask[sn_type - SCTP_SN_TYPE_BASE];
|
|
|
|
|
|
+
|
|
|
|
+ if (offset >= sizeof(struct sctp_event_subscribe))
|
|
|
|
+ return 0;
|
|
|
|
+ return amask[offset];
|
|
}
|
|
}
|
|
|
|
|
|
/* Given an event subscription, is this event enabled? */
|
|
/* Given an event subscription, is this event enabled? */
|