瀏覽代碼

[NETFILTER]: nf_conntrack_sip: check sname != NULL before calling strncmp

The check got lost during the conversion to nf_conntrack.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy 18 年之前
父節點
當前提交
465f90a486
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      net/netfilter/nf_conntrack_sip.c

+ 2 - 1
net/netfilter/nf_conntrack_sip.c

@@ -330,7 +330,8 @@ int ct_sip_get_info(struct nf_conn *ct,
 
 	while (dptr <= limit) {
 		if ((strncmp(dptr, hnfo->lname, hnfo->lnlen) != 0) &&
-		    (strncmp(dptr, hnfo->sname, hnfo->snlen) != 0)) {
+		    (hnfo->sname == NULL ||
+		     strncmp(dptr, hnfo->sname, hnfo->snlen) != 0)) {
 			dptr++;
 			continue;
 		}