From 5606551f38a6e163b786a44d734bcd6e25c2d76c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se>
Date: Tue, 16 Feb 2016 08:11:24 +0100
Subject: [PATCH] =?UTF-8?q?sexp-conv:=20Fail=20with=20an=20error=20message?=
 =?UTF-8?q?=20for=20unexpected=20']'=20characters.=20Fixes=20crash=20repor?=
 =?UTF-8?q?ted=20by=20Hanno=20B=C3=B6ck.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 ChangeLog     | 7 +++++++
 tools/parse.c | 5 ++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 8cb92085..8b430037 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-02-16  Niels Möller  <nisse@lysator.liu.se>
+
+	* tools/parse.c (sexp_parse): Fail with an error message for
+	unexpected ']' characters. Fixes crash reported by Hanno Böck.
+	Also handle SEXP_DISPLAY (internal error) explicitly, without a
+	default clause.
+
 2016-01-28  Niels Möller  <nisse@lysator.liu.se>
 
 	* Released nettle-3.2.
diff --git a/tools/parse.c b/tools/parse.c
index 008f3f14..388139ad 100644
--- a/tools/parse.c
+++ b/tools/parse.c
@@ -165,7 +165,10 @@ sexp_parse(struct sexp_parser *parser,
 	case SEXP_CODING_END:
 	  die("Unexpected end of transport encoding.\n");
 	  
-	default:
+	case SEXP_DISPLAY_END:
+	  die("Unexpected end of display tag.\n");
+
+	case SEXP_DISPLAY:
 	  /* Internal error. */
 	  abort();
 	}
-- 
GitLab