SHA256
1
0
forked from pool/file
OBS User unknown 2007-05-24 22:40:26 +00:00 committed by Git OBS Bridge
parent bfeeb16e55
commit f7a0752200
3 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,23 @@
--- src/funcs.c
+++ src/funcs.c 2007-05-24 14:15:36.218013250 +0200
@@ -26,7 +26,7 @@
*/
#include "file.h"
#include "magic.h"
-#include <assert.h>
+#include <limits.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
@@ -247,7 +247,10 @@ file_getbuffer(struct magic_set *ms)
len = ms->o.size - ms->o.left;
/* * 4 is for octal representation, + 1 is for NUL */
psize = len * 4 + 1;
- assert(psize > len);
+ if (len > (ULONG_MAX - 1) / 4) {
+ file_oomem(ms, len);
+ return NULL;
+ }
if (ms->o.psize < psize) {
if ((pbuf = realloc(ms->o.pbuf, psize)) == NULL) {
file_oomem(ms, psize);

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu May 24 11:58:09 CEST 2007 - werner@suse.de
- Fix of the fix for bug #256290 with CVE-2007-2799
-------------------------------------------------------------------
Mon May 21 11:49:45 CEST 2007 - werner@suse.de

View File

@ -17,7 +17,7 @@ License: Other uncritical OpenSource License
Group: Productivity/File utilities
Autoreqprov: on
Version: 4.20
Release: 15
Release: 17
Summary: A Tool to Determine File Types
Source: ftp://ftp.astron.com/pub/file/file-%{version}.tar.bz2
Patch: file-%{version}.dif
@ -35,6 +35,7 @@ Patch11: file-4.20-reg_startend.dif
Patch12: file-4.20-unused.dif
Patch13: file-4.20-reg_dos.dif
Patch14: file-4.20-option.dif
Patch15: file-4.20-CVE-2007-2799.dif
Patch20: file-4.16-mips.dif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -85,6 +86,7 @@ Authors:
%patch12 -p0 -b .unused
%patch13 -p0 -b .reg
%patch14 -p0 -b .opt
%patch15 -p0 -b .CVE-2007-2799
%ifarch mips
%patch20 -p0 -b .mips
%endif
@ -147,6 +149,8 @@ rm -rf $RPM_BUILD_ROOT
%attr(644,root,root) %{_mandir}/man3/libmagic.3.gz
%changelog
* Thu May 24 2007 - werner@suse.de
- Fix of the fix for bug #256290 with CVE-2007-2799
* Mon May 21 2007 - werner@suse.de
- Expand search area used before regex (also bug #263754)
* Mon May 14 2007 - werner@suse.de