From fd6a79c14ead6eefcb0bc327ea67687952b7ed3a Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Tue, 11 May 2021 13:47:03 +0300 Subject: [PATCH] Fix nncp-daemon segfault when SP fails --- doc/news.ru.texi | 9 +++++++++ doc/news.texi | 9 +++++++++ ports/nncp/Makefile | 2 +- src/cmd/nncp-daemon/main.go | 10 +++++++--- src/nncp.go | 2 +- 5 files changed, 27 insertions(+), 5 deletions(-) diff --git a/doc/news.ru.texi b/doc/news.ru.texi index aa4f62f..10f1630 100644 --- a/doc/news.ru.texi +++ b/doc/news.ru.texi @@ -1,6 +1,15 @@ @node Новости @section Новости +@node Релиз 6.5.0 +@subsection Релиз 6.5.0 +@itemize + +@item +Исправлено падение в @command{nncp-daemon} когда SP рукопожатие не было успешно. + +@end itemize + @node Релиз 6.4.0 @subsection Релиз 6.4.0 @itemize diff --git a/doc/news.texi b/doc/news.texi index 67340e2..a270f3e 100644 --- a/doc/news.texi +++ b/doc/news.texi @@ -3,6 +3,15 @@ See also this page @ref{Новости, on russian}. +@node Release 6.5.0 +@section Release 6.5.0 +@itemize + +@item +Fixed segfault in @command{nncp-daemon} when SP handshake did not succeed. + +@end itemize + @node Release 6.4.0 @section Release 6.4.0 @itemize diff --git a/ports/nncp/Makefile b/ports/nncp/Makefile index c398830..4fd2908 100644 --- a/ports/nncp/Makefile +++ b/ports/nncp/Makefile @@ -1,5 +1,5 @@ PORTNAME= nncp -DISTVERSION= 6.4.0 +DISTVERSION= 6.5.0 CATEGORIES= net MASTER_SITES= http://www.nncpgo.org/download/ diff --git a/src/cmd/nncp-daemon/main.go b/src/cmd/nncp-daemon/main.go index a69175a..a1b7982 100644 --- a/src/cmd/nncp-daemon/main.go +++ b/src/cmd/nncp-daemon/main.go @@ -108,17 +108,21 @@ func performSP( ) }) } else { - nodeId := "unknown" + var nodeId string + var nodeName string if state.Node == nil { + nodeId = "unknown" + nodeName = "unknown" nodeIdC <- nil } else { - nodeIdC <- state.Node.Id nodeId = state.Node.Id.String() + nodeName = state.Node.Name + nodeIdC <- state.Node.Id } ctx.LogI( "call-started", nncp.LEs{{K: "Node", V: nodeId}}, - func(les nncp.LEs) string { return "Connected to " + state.Node.Name }, + func(les nncp.LEs) string { return "Connected to " + nodeName }, ) } close(nodeIdC) diff --git a/src/nncp.go b/src/nncp.go index 7c1b7c5..a9af93c 100644 --- a/src/nncp.go +++ b/src/nncp.go @@ -40,7 +40,7 @@ along with this program. If not, see .` const Base32Encoded32Len = 52 var ( - Version string = "6.4.0" + Version string = "6.5.0" Base32Codec *base32.Encoding = base32.StdEncoding.WithPadding(base32.NoPadding) ) -- 2.44.0