diff --git a/xfsdump-3.0.1-fix-bufferoverflow.diff b/xfsdump-3.0.1-fix-bufferoverflow.diff new file mode 100644 index 0000000..52355ee --- /dev/null +++ b/xfsdump-3.0.1-fix-bufferoverflow.diff @@ -0,0 +1,21 @@ +Index: xfsdump-3.0.1/common/path.c +=================================================================== +--- xfsdump-3.0.1.orig/common/path.c ++++ xfsdump-3.0.1/common/path.c +@@ -283,11 +283,15 @@ pa_gen( pa_t *pap ) + + sz = 0; + for ( i = 0 ; i < pap->pa_cnt ; i++ ) { + sz += strlen( pap->pa_array[ i ] ) + 1; + } +- sz++; ++ sz++; /* '\0' */ ++ /* if pa_cnt == 0, then we need '/' + '\0' */ ++ if ( pap->pa_cnt <= 0 ) { ++ sz++; ++ } + + retp = ( char * )malloc( sz ); + + if ( pap->pa_cnt <= 0 ) { + ASSERT( pap->pa_cnt == 0 ); diff --git a/xfsdump.changes b/xfsdump.changes index 9cf38e9..b5b10c9 100644 --- a/xfsdump.changes +++ b/xfsdump.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Feb 22 23:28:43 CET 2010 - seife@opensuse.org + +- fix buffer overflow (detected by gcc-4.5) + ------------------------------------------------------------------- Tue Jun 23 12:13:33 CEST 2009 - mmarek@suse.cz diff --git a/xfsdump.spec b/xfsdump.spec index d31450b..3760c58 100644 --- a/xfsdump.spec +++ b/xfsdump.spec @@ -1,7 +1,7 @@ # # spec file for package xfsdump (Version 3.0.1) # -# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -21,14 +21,15 @@ Name: xfsdump BuildRequires: e2fsprogs-devel libattr-devel ncurses-devel xfsprogs-devel Version: 3.0.1 -Release: 1 +Release: 2 AutoReqProv: on Group: System/Filesystems -License: GPL v2 or later +License: GPLv2+ Url: http://oss.sgi.com/projects/xfs/ Summary: Administrative Utilities for the XFS File System Source0: xfsdump-%version.tar.bz2 Patch0: xfsdump-docdir.diff +Patch1: xfsdump-3.0.1-fix-bufferoverflow.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -57,6 +58,7 @@ Authors: %prep %setup -q %patch0 +%patch1 -p1 %build export CFLAGS=$RPM_OPT_FLAGS