summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Black <dragonheart@gentoo.org>2009-04-23 14:12:39 +0000
committerDaniel Black <dragonheart@gentoo.org>2009-04-23 14:12:39 +0000
commit35440da112ac0aac812fa4e12f2849589841e333 (patch)
treed1588562525cad8bfe5b4e76a0c14da2762cdfd7 /app-admin/testdisk
parentUpdating manifest (diff)
downloadgentoo-2-35440da112ac0aac812fa4e12f2849589841e333.tar.gz
gentoo-2-35440da112ac0aac812fa4e12f2849589841e333.tar.bz2
gentoo-2-35440da112ac0aac812fa4e12f2849589841e333.zip
version bump
(Portage version: 2.2_rc31/cvs/Linux x86_64)
Diffstat (limited to 'app-admin/testdisk')
-rw-r--r--app-admin/testdisk/ChangeLog11
-rw-r--r--app-admin/testdisk/files/testdisk-6.11-exif_bound_checking.patch131
-rw-r--r--app-admin/testdisk/testdisk-6.11.ebuild (renamed from app-admin/testdisk/testdisk-6.9.ebuild)19
3 files changed, 153 insertions, 8 deletions
diff --git a/app-admin/testdisk/ChangeLog b/app-admin/testdisk/ChangeLog
index 55d1a852258d..43825389bd71 100644
--- a/app-admin/testdisk/ChangeLog
+++ b/app-admin/testdisk/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for app-admin/testdisk
-# Copyright 2000-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/testdisk/ChangeLog,v 1.34 2008/07/19 14:36:35 dragonheart Exp $
+# Copyright 2000-2009 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/testdisk/ChangeLog,v 1.35 2009/04/23 14:12:38 dragonheart Exp $
+
+*testdisk-6.11 (23 Apr 2009)
+
+ 23 Apr 2009; Daniel Black <dragonheart@gentoo.org>
+ +files/testdisk-6.11-exif_bound_checking.patch, -testdisk-6.9.ebuild,
+ +testdisk-6.11.ebuild:
+ version bump
*testdisk-6.10 (19 Jul 2008)
diff --git a/app-admin/testdisk/files/testdisk-6.11-exif_bound_checking.patch b/app-admin/testdisk/files/testdisk-6.11-exif_bound_checking.patch
new file mode 100644
index 000000000000..b0f5020999c3
--- /dev/null
+++ b/app-admin/testdisk/files/testdisk-6.11-exif_bound_checking.patch
@@ -0,0 +1,131 @@
+diff -ru testdisk-6.11/src/file_jpg.c testdisk-6.11.1/src/file_jpg.c
+--- testdisk-6.11/src/file_jpg.c 2009-04-08 12:24:02.000000000 +0200
++++ testdisk-6.11.1/src/file_jpg.c 2009-04-23 12:19:27.000000000 +0200
+@@ -100,14 +100,10 @@
+ if(buffer[i]!=0xff)
+ return 0;
+ /* 0xe0 APP0 */
++ /* 0xef APP15 */
+ /* 0xfe COM */
+ /* 0xdb DQT */
+- if(buffer[i+1]==0xe0 ||
+- buffer[i+1]==0xfe ||
+- buffer[i+1]==0xdb)
+- {
+- }
+- else if(buffer[i+1]==0xe1)
++ if(buffer[i+1]==0xe1)
+ { /* APP1 Exif information */
+ if(i+0x0A < buffer_size && 2+(buffer[i+2]<<8)+buffer[i+3] > 0x0A)
+ {
+@@ -117,12 +113,17 @@
+ file_recovery_new->time=get_date_from_tiff_header((const TIFFHeader*)&buffer[i+0x0A], tiff_size);
+ }
+ }
++ else if((buffer[i+1]>=0xe0 && buffer[i+1]<=0xef) ||
++ buffer[i+1]==0xfe ||
++ buffer[i+1]==0xdb)
++ {
++ }
+ else
+ {
+ reset_file_recovery(file_recovery_new);
+ file_recovery_new->extension=file_hint_jpg.extension;
+ file_recovery_new->file_check=&file_check_jpg;
+- file_recovery_new->min_filesize=288;
++ file_recovery_new->min_filesize=(i>288?i:288);
+ file_recovery_new->data_check=&data_check_jpg;
+ file_recovery_new->calculated_file_size=2;
+ return 1;
+@@ -511,7 +512,7 @@
+ const unsigned int thumb_offset=thumb_data-(const char*)buffer;
+ const unsigned int thumb_size=ifbytecount-(const char*)tiff;
+ unsigned int j_old;
+- if(thumb_offset+thumb_size < sizeof(buffer))
++ if(thumb_offset < sizeof(buffer) && thumb_offset+thumb_size < sizeof(buffer))
+ {
+ unsigned int j=thumb_offset+2;
+ unsigned int thumb_sos_found=0;
+diff -ru testdisk-6.11/src/file_tiff.c testdisk-6.11.1/src/file_tiff.c
+--- testdisk-6.11/src/file_tiff.c 2009-04-13 12:00:24.000000000 +0200
++++ testdisk-6.11.1/src/file_tiff.c 2009-04-23 12:12:21.000000000 +0200
+@@ -65,6 +65,10 @@
+ const uint32_t *tiff_next_diroff;
+ const TIFFDirEntry *ifd;
+ unsigned int j;
++ /* Bound checking */
++ if((const char*)ifd0 < (const char*)tiff ||
++ (const char*)(ifd0+1) > (const char*)tiff + tiff_size)
++ return NULL;
+ for(j=0, ifd=&ifd0->ifd;
+ (const char*)(ifd+1) <= (const char*)tiff+tiff_size && j<be16(ifd0->nbr_fields);
+ j++, ifd++)
+@@ -75,7 +79,9 @@
+ exififd=(const struct ifd_header *)((const char*)tiff + be32(ifd->tdir_offset));
+ }
+ tiff_next_diroff=(const uint32_t *)ifd;
+- if(exififd!=NULL)
++ if(exififd!=NULL &&
++ (const char*)exififd > (const char*)tiff &&
++ (const char*)(exififd+1) <= (const char*)tiff + tiff_size)
+ { /* Exif */
+ for(j=0, ifd=&exififd->ifd;
+ (const char*)(ifd+1) <= (const char*)tiff+tiff_size && j<be16(exififd->nbr_fields);
+@@ -89,6 +95,9 @@
+ if(be32(*tiff_next_diroff)>0)
+ {
+ const const struct ifd_header *ifd1=(const struct ifd_header*)((const char *)tiff+be32(*tiff_next_diroff));
++ if((const char*)ifd1 <= (const char*)tiff ||
++ (const char*)(ifd1+1) > (const char*)tiff+tiff_size)
++ return NULL;
+ for(j=0, ifd=&ifd1->ifd;
+ (const char*)(ifd+1) <= (const char*)tiff+tiff_size && j<be16(ifd1->nbr_fields);
+ j++, ifd++)
+@@ -107,6 +116,10 @@
+ const uint32_t *tiff_next_diroff;
+ const TIFFDirEntry *ifd;
+ unsigned int j;
++ /* Bound checking */
++ if((const char*)ifd0 < (const char*)tiff ||
++ (const char*)(ifd0+1) > (const char*)tiff + tiff_size)
++ return NULL;
+ for(j=0, ifd=&ifd0->ifd;
+ (const char*)(ifd+1) <= (const char*)tiff+tiff_size && j<le16(ifd0->nbr_fields);
+ j++, ifd++)
+@@ -117,7 +130,9 @@
+ exififd=(const struct ifd_header *)((const char*)tiff + le32(ifd->tdir_offset));
+ }
+ tiff_next_diroff=(const uint32_t *)ifd;
+- if(exififd!=NULL)
++ if(exififd!=NULL &&
++ (const char*)exififd > (const char*)tiff &&
++ (const char*)(exififd+1) <= (const char*)tiff + tiff_size)
+ { /* Exif */
+ for(j=0, ifd=&exififd->ifd;
+ (const char*)(ifd+1) <= (const char*)tiff+tiff_size && j<le16(exififd->nbr_fields);
+@@ -131,6 +146,10 @@
+ if(le32(*tiff_next_diroff)>0)
+ {
+ const const struct ifd_header *ifd1=(const struct ifd_header*)((const char *)tiff+le32(*tiff_next_diroff));
++ /* Bound checking */
++ if((const char*)(ifd1) <= (const char*)tiff ||
++ (const char*)(ifd1+1) > (const char*)tiff+tiff_size)
++ return NULL;
+ for(j=0, ifd=&ifd1->ifd;
+ (const char*)(ifd+1) <= (const char*)tiff+tiff_size && j<le16(ifd1->nbr_fields);
+ j++, ifd++)
+@@ -168,11 +187,11 @@
+ /* DateTimeOriginal */
+ date_asc=find_tag_from_tiff_header(tiff, tiff_size, 0x9003);
+ /* DateTimeDigitalized*/
+- if(date_asc==NULL || &date_asc[18] >= (const char *)tiff + tiff_size)
++ if(date_asc==NULL || date_asc < (const char *)tiff || &date_asc[18] >= (const char *)tiff + tiff_size)
+ date_asc=find_tag_from_tiff_header(tiff, tiff_size, 0x9004);
+- if(date_asc==NULL || &date_asc[18] >= (const char *)tiff + tiff_size)
++ if(date_asc==NULL || date_asc < (const char *)tiff || &date_asc[18] >= (const char *)tiff + tiff_size)
+ date_asc=find_tag_from_tiff_header(tiff, tiff_size, 0x132);
+- if(date_asc==NULL || &date_asc[18] >= (const char *)tiff + tiff_size)
++ if(date_asc==NULL || date_asc < (const char *)tiff || &date_asc[18] >= (const char *)tiff + tiff_size)
+ return (time_t)0;
+ memset(&tm_time, 0, sizeof(tm_time));
+ tm_time.tm_sec=(date_asc[17]-'0')*10+(date_asc[18]-'0'); /* seconds 0-59 */
diff --git a/app-admin/testdisk/testdisk-6.9.ebuild b/app-admin/testdisk/testdisk-6.11.ebuild
index 5b87a8dd5f16..7f44d72f7d57 100644
--- a/app-admin/testdisk/testdisk-6.9.ebuild
+++ b/app-admin/testdisk/testdisk-6.11.ebuild
@@ -1,12 +1,14 @@
-# Copyright 1999-2008 Gentoo Foundation
+# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/testdisk/testdisk-6.9.ebuild,v 1.1 2008/04/01 23:54:25 dragonheart Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-admin/testdisk/testdisk-6.11.ebuild,v 1.1 2009/04/23 14:12:38 dragonheart Exp $
+EAPI=2
inherit eutils flag-o-matic
DESCRIPTION="Checks and undeletes partitions + PhotoRec, signature based recovery tool"
HOMEPAGE="http://www.cgsecurity.org/wiki/TestDisk"
SRC_URI="http://www.cgsecurity.org/${P}.tar.bz2"
+#SRC_URI="http://www.cgsecurity.org/${P}-WIP.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86"
@@ -17,10 +19,17 @@ DEPEND=">=sys-libs/ncurses-5.2
jpeg? ( media-libs/jpeg )
ntfs? ( >=sys-fs/ntfsprogs-2.0.0 )
reiserfs? ( >=sys-fs/progsreiserfs-0.3.1_rc8 )
- >=sys-fs/e2fsprogs-1.35"
+ >=sys-fs/e2fsprogs-1.35
+ sys-libs/zlib"
RDEPEND="!static? ( ${DEPEND} )"
-src_compile() {
+#S=${WORKDIR}/${P}-WIP
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-exif_bound_checking.patch
+}
+
+src_configure() {
local myconf="--without-ewf --enable-sudo"
# --with-foo are broken, any use of --with/--without disable the
# functionality.
@@ -45,8 +54,6 @@ src_compile() {
if useq jpeg && egrep -q 'undef HAVE_LIBJPEG\>' "${S}"/config.h ; then
die "Failed to find jpeg library."
fi
-
- emake || die
}
src_install() {