aboutsummaryrefslogtreecommitdiffstats
path: root/net/x25/x25_facilities.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/x25/x25_facilities.c')
-rw-r--r--net/x25/x25_facilities.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/x25/x25_facilities.c b/net/x25/x25_facilities.c
index 771bab00754b..3a8c4c419cd4 100644
--- a/net/x25/x25_facilities.c
+++ b/net/x25/x25_facilities.c
@@ -134,15 +134,15 @@ int x25_parse_facilities(struct sk_buff *skb, struct x25_facilities *facilities,
134 case X25_FAC_CLASS_D: 134 case X25_FAC_CLASS_D:
135 switch (*p) { 135 switch (*p) {
136 case X25_FAC_CALLING_AE: 136 case X25_FAC_CALLING_AE:
137 if (p[1] > X25_MAX_DTE_FACIL_LEN) 137 if (p[1] > X25_MAX_DTE_FACIL_LEN || p[1] <= 1)
138 break; 138 return 0;
139 dte_facs->calling_len = p[2]; 139 dte_facs->calling_len = p[2];
140 memcpy(dte_facs->calling_ae, &p[3], p[1] - 1); 140 memcpy(dte_facs->calling_ae, &p[3], p[1] - 1);
141 *vc_fac_mask |= X25_MASK_CALLING_AE; 141 *vc_fac_mask |= X25_MASK_CALLING_AE;
142 break; 142 break;
143 case X25_FAC_CALLED_AE: 143 case X25_FAC_CALLED_AE:
144 if (p[1] > X25_MAX_DTE_FACIL_LEN) 144 if (p[1] > X25_MAX_DTE_FACIL_LEN || p[1] <= 1)
145 break; 145 return 0;
146 dte_facs->called_len = p[2]; 146 dte_facs->called_len = p[2];
147 memcpy(dte_facs->called_ae, &p[3], p[1] - 1); 147 memcpy(dte_facs->called_ae, &p[3], p[1] - 1);
148 *vc_fac_mask |= X25_MASK_CALLED_AE; 148 *vc_fac_mask |= X25_MASK_CALLED_AE;