浏览代码

init_naptr_proto_prefs sctp fix

- fixed init_naptr_proto_prefs sanity checks
Andrei Pelinescu-Onciul 17 年之前
父节点
当前提交
1cdf6bc020
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      resolve.c

+ 3 - 3
resolve.c

@@ -74,14 +74,14 @@
 #define local_free   pkg_free
 #define local_free   pkg_free
 
 
 #ifdef USE_NAPTR
 #ifdef USE_NAPTR
-static int naptr_proto_pref[PROTO_LAST];
+static int naptr_proto_pref[PROTO_LAST+1];
 #endif
 #endif
 
 
 #ifdef USE_NAPTR
 #ifdef USE_NAPTR
 void init_naptr_proto_prefs()
 void init_naptr_proto_prefs()
 {
 {
-	if ((PROTO_UDP >= PROTO_LAST) || (PROTO_TCP >= PROTO_LAST) ||
-		(PROTO_TLS >= PROTO_LAST) || (PROTO_SCTP>=PROTO_LAST)){
+	if ((PROTO_UDP > PROTO_LAST) || (PROTO_TCP > PROTO_LAST) ||
+		(PROTO_TLS > PROTO_LAST) || (PROTO_SCTP > PROTO_LAST)){
 		BUG("init_naptr_proto_prefs: array too small \n");
 		BUG("init_naptr_proto_prefs: array too small \n");
 		return;
 		return;
 	}
 	}