Skip to content
Snippets Groups Projects
Commit 6047db74 authored by Tobias Powalowski's avatar Tobias Powalowski :sunglasses:
Browse files

fix buffer overflow #35734

parent bd7ab3d0
No related branches found
No related tags found
No related merge requests found
--- src/mkfs.fat.c.old 2013-06-09 12:30:43.626408604 -0400
+++ src/mkfs.fat.c 2013-06-09 12:30:28.306756934 -0400
@@ -743,10 +743,10 @@
* differently: The jump code is only 2 bytes (and m68k machine code
* :-), then 6 bytes filler (ignored), then 3 byte serial number. */
bs.boot_jump[2] = 'm';
- strcpy((char *)bs.system_id, "kdosf");
+ memcpy((char *)bs.system_id, "kdosf", strlen("kdosf"));
}
else
- strcpy((char *)bs.system_id, "mkfs.fat");
+ memcpy((char *)bs.system_id, "mkfs.fat", strlen("mkfs.fat"));
if (sectors_per_cluster)
bs.cluster_size = (char)sectors_per_cluster;
if (size_fat == 32) {
......@@ -2,16 +2,19 @@
# Committer: Judd Vinet <jvinet@zeroflux.org>
pkgname=dosfstools
pkgver=3.0.18
pkgrel=1
pkgrel=2
pkgdesc="DOS filesystem utilities"
arch=(i686 x86_64)
depends=('glibc')
source=(http://www.daniel-baumann.ch/files/software/$pkgname/$pkgname-$pkgver.tar.xz{,.sig})
source=(http://www.daniel-baumann.ch/files/software/$pkgname/$pkgname-$pkgver.tar.xz{,.sig}
3.0.18-use-memcpy-instead-of-strcpy.patch)
url="http://www.daniel-baumann.ch/software/dosfstools/"
license=('GPL2')
md5sums=('a80aab6aac9e56e937b0392a85bfadb9'
'SKIP')
prepare() {
cd $srcdir/$pkgname-$pkgver
patch -Np0 -i ../3.0.18-use-memcpy-instead-of-strcpy.patch
}
build() {
cd $srcdir/$pkgname-$pkgver
make
......@@ -21,3 +24,6 @@ package () {
cd $srcdir/$pkgname-$pkgver
make DESTDIR=$pkgdir PREFIX=/usr SBINDIR=/usr/bin MANDIR=/usr/share/man DOCDIR=/usr/share/doc install
}
md5sums=('a80aab6aac9e56e937b0392a85bfadb9'
'SKIP'
'771cf771aadce6ab0b1c9944bf535011')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment