Add patch for #982685

This commit is contained in:
Simone Caronni 2013-07-16 08:36:27 +02:00
parent 14100accd3
commit 3f2f9bf85b
2 changed files with 39 additions and 1 deletions

View File

@ -0,0 +1,33 @@
From 068ab9f61196b01235173623c1cca3143cf1d43a Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
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

View File

@ -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 <negativo17@gmail.com> - 0.5.4-4
- Add patch for #982685.
* Mon Jun 10 2013 Simone Caronni <negativo17@gmail.com> - 0.5.4-3
- Clean up SPEC file and fix rpmlint complaints.