瀏覽代碼

SCTP: Fix chunk acceptance when no authenticated chunks were listed.

In the case where no autheticated chunks were specified, we were still
trying to verify that a given chunk needs authentication and doing so
incorrectly.  Add a check for parameter length to make sure we don't
try to use an empty auth_chunks parameter to verify against.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Vlad Yasevich 17 年之前
父節點
當前提交
555d3d5d2b
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      net/sctp/auth.c

+ 1 - 1
net/sctp/auth.c

@@ -631,7 +631,7 @@ static int __sctp_auth_cid(sctp_cid_t chunk, struct sctp_chunks_param *param)
 	int found = 0;
 	int found = 0;
 	int i;
 	int i;
 
 
-	if (!param)
+	if (!param || param->param_hdr.length == 0)
 		return 0;
 		return 0;
 
 
 	len = ntohs(param->param_hdr.length) - sizeof(sctp_paramhdr_t);
 	len = ntohs(param->param_hdr.length) - sizeof(sctp_paramhdr_t);