diff options
author | Colin Watson <cjwatson@debian.org> | 2008-11-23 14:44:44 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2008-11-23 14:44:44 +0000 |
commit | eb839492d5500cf0338661197702239cfdf7196c (patch) | |
tree | 8c8471b9f81bb8d9286eac38e7f21cbdd4e17d2c | |
parent | f063add71b66011cca8c313fe0c681b0f0e1b97f (diff) |
Fix double-free when failing to parse a forwarding specification given
using ~C (closes: #505330; forwarded upstream as
https://bugzilla.mindrot.org/show_bug.cgi?id=1539).
-rw-r--r-- | debian/changelog | 3 | ||||
-rw-r--r-- | readconf.c | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog index 7b05bd269..b09f7a306 100644 --- a/debian/changelog +++ b/debian/changelog | |||
@@ -7,6 +7,9 @@ openssh (1:5.1p1-4) UNRELEASED; urgency=low | |||
7 | - Only send eow and no-more-sessions requests to openssh 5 and newer; | 7 | - Only send eow and no-more-sessions requests to openssh 5 and newer; |
8 | fixes interop problems with broken ssh v2 implementations (closes: | 8 | fixes interop problems with broken ssh v2 implementations (closes: |
9 | #495917). | 9 | #495917). |
10 | * Fix double-free when failing to parse a forwarding specification given | ||
11 | using ~C (closes: #505330; forwarded upstream as | ||
12 | https://bugzilla.mindrot.org/show_bug.cgi?id=1539). | ||
10 | 13 | ||
11 | -- Colin Watson <cjwatson@debian.org> Thu, 09 Oct 2008 12:52:34 +0100 | 14 | -- Colin Watson <cjwatson@debian.org> Thu, 09 Oct 2008 12:52:34 +0100 |
12 | 15 | ||
diff --git a/readconf.c b/readconf.c index 7ad5a8e18..043673ced 100644 --- a/readconf.c +++ b/readconf.c | |||
@@ -1334,9 +1334,13 @@ parse_forward(Forward *fwd, const char *fwdspec) | |||
1334 | return (i); | 1334 | return (i); |
1335 | 1335 | ||
1336 | fail_free: | 1336 | fail_free: |
1337 | if (fwd->connect_host != NULL) | 1337 | if (fwd->connect_host != NULL) { |
1338 | xfree(fwd->connect_host); | 1338 | xfree(fwd->connect_host); |
1339 | if (fwd->listen_host != NULL) | 1339 | fwd->connect_host = NULL; |
1340 | } | ||
1341 | if (fwd->listen_host != NULL) { | ||
1340 | xfree(fwd->listen_host); | 1342 | xfree(fwd->listen_host); |
1343 | fwd->connect_host = NULL; | ||
1344 | } | ||
1341 | return (0); | 1345 | return (0); |
1342 | } | 1346 | } |