summary refs log tree commit diff
path: root/gnu/packages/patches/libssh-hostname-parser-bug.patch
diff options
context:
space:
mode:
authorLeo Famulari <leo@famulari.name>2017-06-07 12:11:24 -0400
committerLeo Famulari <leo@famulari.name>2017-06-07 12:11:55 -0400
commitc67d587f94173fd42d65097165afc5c512935646 (patch)
treeee2bac9d683d0dec98d611d5e590b06d9876cad3 /gnu/packages/patches/libssh-hostname-parser-bug.patch
parent4f493cba06b97de756123b3855ea52dcf1ad3555 (diff)
parent4679dd6967c21e21c740cd88e17191b8e2aac5ee (diff)
downloadguix-c67d587f94173fd42d65097165afc5c512935646.tar.gz
Merge branch 'master' into core-updates
This merge commit includes a fix for CVE-2017-6512 in Perl 5.26.0.
Diffstat (limited to 'gnu/packages/patches/libssh-hostname-parser-bug.patch')
-rw-r--r--gnu/packages/patches/libssh-hostname-parser-bug.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/gnu/packages/patches/libssh-hostname-parser-bug.patch b/gnu/packages/patches/libssh-hostname-parser-bug.patch
new file mode 100644
index 0000000000..69f46cbdd6
--- /dev/null
+++ b/gnu/packages/patches/libssh-hostname-parser-bug.patch
@@ -0,0 +1,31 @@
+Fix "Hostname" parsing in OpenSSH config files, as reported
+at <https://red.libssh.org/issues/260>.
+
+From: Niels Ole Salscheider <niels_ole@salscheider-online.de>
+Date: Mon, 8 May 2017 17:36:13 +0200
+Subject: [PATCH] Fix reading of the first parameter
+
+This is a fixup for 7b8b5eb4eac314a3a29be812bef0264c6611f6e7.
+Previously, it would return as long as the parameter was _not_ seen
+before. It also did not handle the case for the unsupported opcode (-1)
+which would cause a segfault when accessing the "seen" array.
+---
+ src/config.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/config.c b/src/config.c
+index 7c03b27..238a655 100644
+--- a/src/config.c
++++ b/src/config.c
+@@ -218,8 +218,9 @@ static int ssh_config_parse_line(ssh_session session, const char *line,
+   }
+ 
+   opcode = ssh_config_get_opcode(keyword);
+-  if (*parsing == 1 && opcode != SOC_HOST) {
+-      if (seen[opcode] == 0) {
++  if (*parsing == 1 && opcode != SOC_HOST &&
++      opcode > SOC_UNSUPPORTED && opcode < SOC_END) {
++      if (seen[opcode] == 1) {
+           return 0;
+       }
+       seen[opcode] = 1;