From 3f2f9bf85bb3b319b34866d79694799427f67fed Mon Sep 17 00:00:00 2001 From: Simone Caronni Date: Tue, 16 Jul 2013 08:36:27 +0200 Subject: [PATCH] Add patch for #982685 --- libssh-channel-close.patch | 33 +++++++++++++++++++++++++++++++++ libssh.spec | 7 ++++++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 libssh-channel-close.patch diff --git a/libssh-channel-close.patch b/libssh-channel-close.patch new file mode 100644 index 0000000..65c8a2f --- /dev/null +++ b/libssh-channel-close.patch @@ -0,0 +1,33 @@ +From 068ab9f61196b01235173623c1cca3143cf1d43a Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko +Date: Sat, 13 Jul 2013 14:13:52 +0400 +Subject: [PATCH] Check for NULL pointers in ssh_channel_close + +--- + src/channels.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/src/channels.c b/src/channels.c +index 214485c..3fac10e 100644 +--- a/src/channels.c ++++ b/src/channels.c +@@ -1080,9 +1080,15 @@ error: + * @see channel_eof() + */ + int ssh_channel_close(ssh_channel channel){ +- ssh_session session = channel->session; ++ ssh_session session; + int rc = 0; + ++ if (channel == NULL) { ++ return SSH_ERROR; ++ } ++ ++ session = channel->session; ++ + enter_function(); + + if (channel->local_eof == 0) { +-- +1.8.3.1 + diff --git a/libssh.spec b/libssh.spec index 1924d20..7a50b0e 100644 --- a/libssh.spec +++ b/libssh.spec @@ -1,12 +1,13 @@ Name: libssh Version: 0.5.4 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A library implementing the SSH2 protocol (0xbadc0de version) License: LGPLv2+ URL: http://www.libssh.org/ Source0: https://red.libssh.org/attachments/download/41/libssh-0.5.4.tar.gz Source1: https://red.libssh.org/attachments/download/42/libssh-0.5.4.tar.asc +Patch0: libssh-channel-close.patch BuildRequires: cmake BuildRequires: openssl-devel @@ -30,6 +31,7 @@ applications that use %{name}. %prep %setup -q +%patch0 -p1 -b .channel-close %build mkdir obj @@ -59,6 +61,9 @@ mv %{buildroot}/%{_libdir}/pkgconfig %{buildroot}/usr/share %{_libdir}/*.so %changelog +* Tue Jul 16 2013 Simone Caronni - 0.5.4-4 +- Add patch for #982685. + * Mon Jun 10 2013 Simone Caronni - 0.5.4-3 - Clean up SPEC file and fix rpmlint complaints.