]> git.pld-linux.org Git - packages/file.git/blob - file-CVE-2014-3587.patch
- fix for CVE-2014-3587
[packages/file.git] / file-CVE-2014-3587.patch
1 commit 0641e56be1af003aa02c7c6b0184466540637233
2 Author: Christos Zoulas <christos@zoulas.com>
3 Date:   Thu Aug 7 09:38:35 2014 +0000
4
5     Prevent wrap around (Remi Collet at redhat)
6
7 diff --git a/src/cdf.c b/src/cdf.c
8 index 5dbf3b1..3e691f4 100644
9 --- a/src/cdf.c
10 +++ b/src/cdf.c
11 @@ -35,7 +35,7 @@
12  #include "file.h"
13  
14  #ifndef lint
15 -FILE_RCSID("@(#)$File: cdf.c,v 1.63 2014/06/09 13:04:37 christos Exp $")
16 +FILE_RCSID("@(#)$File: cdf.c,v 1.64 2014/07/24 19:35:39 christos Exp $")
17  #endif
18  
19  #include <assert.h>
20 @@ -835,6 +835,10 @@ cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h,
21                 q = (const uint8_t *)(const void *)
22                     ((const char *)(const void *)p + ofs
23                     - 2 * sizeof(uint32_t));
24 +               if (q < p) {
25 +                       DPRINTF(("Wrapped around %p < %p\n", q, p));
26 +                       goto out;
27 +               }
28                 if (q > e) {
29                         DPRINTF(("Ran of the end %p > %p\n", q, e));
30                         goto out;
This page took 0.04254 seconds and 3 git commands to generate.