From d2eca98337190e067f931a6d28bf63488a6caaa6 Mon Sep 17 00:00:00 2001 From: Yuuki Wakisaka Date: Tue, 17 Mar 2020 14:57:36 +0900 Subject: [PATCH] fix #95 infinity loop when WKS record has over port number 65528 --- host2str.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/host2str.c b/host2str.c index 29a5f5c9..d8108db0 100644 --- a/host2str.c +++ b/host2str.c @@ -855,6 +855,8 @@ ldns_rdf2buffer_str_wks(ldns_buffer *output, const ldns_rdf *rdf) endservent(); #endif } + /* exit from loop before integer overflow */ + if(current_service == 65535) { break; } } return ldns_buffer_status(output); } -- 2.47.3