Add patch to fix NULL pointer dereference when ip= is provided on command

line
This commit is contained in:
Jeff Layton 2010-03-08 16:31:17 +00:00
parent 64f0fa50a1
commit bad489c3ee
2 changed files with 35 additions and 2 deletions

View File

@ -0,0 +1,26 @@
From cff3f7cb2b94aec118f27ee8dd904ef216489938 Mon Sep 17 00:00:00 2001
From: Jeff Layton <jlayton@redhat.com>
Date: Sun, 7 Mar 2010 18:49:33 -0500
Subject: [PATCH] mount.cifs: check for NULL addr pointer before handling scopeid
Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
mount.cifs.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mount.cifs.c b/mount.cifs.c
index 5237476..4e38415 100644
--- a/mount.cifs.c
+++ b/mount.cifs.c
@@ -1604,7 +1604,7 @@ mount_retry:
}
}
- if (addr->ai_addr->sa_family == AF_INET6 && addr6->sin6_scope_id) {
+ if (addr && addr->ai_addr->sa_family == AF_INET6 && addr6->sin6_scope_id) {
strlcat(options, "%", options_size);
current_len = strnlen(options, options_size);
optionstail = options + current_len;
--
1.6.6.1

View File

@ -3,15 +3,17 @@
Name: cifs-utils
Version: 4.0
Release: 1%{pre_release}%{?dist}
Release: 2%{pre_release}%{?dist}
Summary: Utilities for mounting and managing CIFS mounts
Group: System Environment/Daemons
License: GPLv3
URL: http://linux-cifs.samba.org/
Source0: ftp://ftp.samba.org/pub/linux-cifs/cifs-utils/%{name}-%{version}%{pre_release}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}%{pre_release}-%{release}-root-%(%{__id_u} -n)
Source0: ftp://ftp.samba.org/pub/linux-cifs/cifs-utils/%{name}-%{version}%{pre_release}.tar.bz2
Patch1: cifs-utils-4.0-mount-cifs-addr-null-ptr.patch
BuildRequires: libtalloc-devel krb5-devel keyutils-libs-devel autoconf automake
Requires: keyutils
@ -26,6 +28,8 @@ file system.
%prep
%setup -q -n %{name}-%{version}%{pre_release}
%patch1 -p1
%build
%configure --prefix=/usr
make %{?_smp_mflags}
@ -46,6 +50,9 @@ rm -rf %{buildroot}
%{_mandir}/man8/mount.cifs.8.gz
%changelog
* Mon Mar 08 2010 Jeff Layton <jlayton@redhat.com> 4.0-2
- fix bad pointer dereference in IPv6 scopeid handling
* Wed Mar 03 2010 Jeff Layton <jlayton@redhat.com> 4.0-1
- update to 4.0
- minor specfile fixes