Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 627900
Collapse All | Expand All

(-)a/net-libs/libssh/files/libssh-0.7.5-fix-config-buffer-underflow.patch (+25 lines)
Line 0 Link Here
1
From 0cffb88b80b1e8b7e292646b955e9b9ca02315c4 Mon Sep 17 00:00:00 2001
2
From: Aris Adamantiadis <aris@0xbadc0de.be>
3
Date: Thu, 8 Jun 2017 00:22:02 +0200
4
Subject: config: fix buffer underflow with unrecognized opcodes
5
6
---
7
 src/config.c | 2 +-
8
 1 file changed, 1 insertion(+), 1 deletion(-)
9
10
diff --git a/src/config.c b/src/config.c
11
index 519926e7..6187c90f 100644
12
--- a/src/config.c
13
+++ b/src/config.c
14
@@ -218,7 +218,7 @@ static int ssh_config_parse_line(ssh_session session, const char *line,
15
   }
16
 
17
   opcode = ssh_config_get_opcode(keyword);
18
-  if (*parsing == 1 && opcode != SOC_HOST) {
19
+  if (*parsing == 1 && opcode != SOC_HOST && opcode != SOC_UNSUPPORTED) {
20
       if (seen[opcode] != 0) {
21
           return 0;
22
       }
23
-- 
24
cgit v1.1
25
(-)a/net-libs/libssh/files/libssh-0.7.5-fix-config-parsing.patch (+32 lines)
Line 0 Link Here
1
From 5333be5988c3789e7011598995f4df90d50d84d0 Mon Sep 17 00:00:00 2001
2
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
3
Date: Sun, 4 Jun 2017 11:54:55 +0300
4
Subject: config: Bugfix: Don't skip unseen opcodes
5
6
libssh fails to read the configuration from a config file due to a
7
wrong check in 'ssh_config_parse_line' procedure in 'config.c'; it's
8
effectively skipping every opcode (and therefore every option) from
9
the file.  The change fixes that behaviour.
10
11
Signed-off-by: Artyom V. Poptsov <poptsov.artyom@gmail.com>
12
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
13
---
14
 src/config.c | 2 +-
15
 1 file changed, 1 insertion(+), 1 deletion(-)
16
17
diff --git a/src/config.c b/src/config.c
18
index 6478fc5f..519926e7 100644
19
--- a/src/config.c
20
+++ b/src/config.c
21
@@ -219,7 +219,7 @@ static int ssh_config_parse_line(ssh_session session, const char *line,
22
 
23
   opcode = ssh_config_get_opcode(keyword);
24
   if (*parsing == 1 && opcode != SOC_HOST) {
25
-      if (seen[opcode] == 0) {
26
+      if (seen[opcode] != 0) {
27
           return 0;
28
       }
29
       seen[opcode] = 1;
30
-- 
31
cgit v1.1
32
(-)a/net-libs/libssh/libssh-0.7.5.ebuild (-1 / +2 lines)
Lines 37-42 S="${WORKDIR}/${MY_P}" Link Here
37
37
38
PATCHES=(
38
PATCHES=(
39
	"${FILESDIR}"/${PN}-0.5.0-tests.patch
39
	"${FILESDIR}"/${PN}-0.5.0-tests.patch
40
	"${FILESDIR}"/${P}-fix-config-parsing.patch
41
	"${FILESDIR}"/${P}-fix-config-buffer-underflow.patch
40
)
42
)
41
43
42
src_prepare() {
44
src_prepare() {
43
- 

Return to bug 627900