- Fixed buffer overflow in alloc_rootdir_entry (#674095)

- Dropped fix-reclaim-file patch, obsoleted by fix-alloc-rootdir-entry patch
This commit is contained in:
Jaroslav Škarvada 2011-02-14 18:07:19 +01:00
commit 4e0ece2e97
3 changed files with 21 additions and 15 deletions

View File

@ -0,0 +1,14 @@
--- dosfstools-3.0.9/src/check.c.old 2010-01-23 10:13:17.000000000 +0100
+++ dosfstools-3.0.9/src/check.c 2011-01-31 17:43:31.462674941 +0100
@@ -174,7 +174,10 @@
offset = fs->root_start+next_free*sizeof(DIR_ENT);
memset(de,0,sizeof(DIR_ENT));
while (1) {
- sprintf(de->name,pattern,curr_num);
+ char expanded[12];
+ sprintf(expanded, pattern, curr_num);
+ memcpy(de->name, expanded, 8);
+ memcpy(de->ext, expanded+8, 3);
for (scan = 0; scan < fs->root_entries; scan++)
if (scan != next_free &&
!strncmp(root[scan].name,de->name,MSDOS_NAME))

View File

@ -1,11 +0,0 @@
--- dosfstools-3.0.9/src/fat.c.old 2010-01-23 10:13:34.000000000 +0100
+++ dosfstools-3.0.9/src/fat.c 2010-12-10 14:36:29.510247580 +0100
@@ -486,7 +486,7 @@
DIR_ENT de;
loff_t offset;
files++;
- offset = alloc_rootdir_entry(fs,&de,"FSCK%04dREC");
+ offset = alloc_rootdir_entry(fs,&de,"FSCK%04d");
de.start = CT_LE_W(i&0xffff);
if (fs->fat_bits == 32)
de.starthi = CT_LE_W(i>>16);

View File

@ -1,14 +1,14 @@
Name: dosfstools
Summary: Utilities for making and checking MS-DOS FAT filesystems on Linux
Version: 3.0.11
Release: 2%{?dist}
Release: 3%{?dist}
License: GPLv3+
Group: Applications/System
Source0: http://www.daniel-baumann.ch/software/dosfstools/%{name}-%{version}.tar.bz2
URL: http://www.daniel-baumann.ch/software/dosfstools/
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# Fix buffer overflow in reclaim file (#660154)
Patch0: dosfstools-3.0.9-fix-reclaim-file.patch
# Fix buffer overflow in alloc_rootdir_entry (#674095)
Patch0: dosfstools-3.0.9-fix-alloc-rootdir-entry.patch
%description
The dosfstools package includes the mkdosfs and dosfsck utilities,
@ -17,7 +17,7 @@ drives or on floppies.
%prep
%setup -q
%patch0 -p1 -b .fix-reclaim-file
%patch0 -p1 -b .fix-alloc-rootdir-entry
%build
make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing"
@ -36,6 +36,9 @@ rm -rf %{buildroot}
%{_mandir}/man8/*
%changelog
- Fixed buffer overflow in alloc_rootdir_entry (#674095)
- Dropped fix-reclaim-file patch, obsoleted by fix-alloc-rootdir-entry patch
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.11-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild