Added
Link Here
|
1 |
Fix for CVE-2006-3376. |
2 |
|
3 |
Obtained from: Ubuntu |
4 |
--- src/player.c |
5 |
+++ src/player.c |
6 |
@@ -23,6 +23,7 @@ |
7 |
|
8 |
#include <stdio.h> |
9 |
#include <stdlib.h> |
10 |
+#include <stdint.h> |
11 |
#include <string.h> |
12 |
#include <math.h> |
13 |
|
14 |
@@ -132,8 +133,14 @@ |
15 |
} |
16 |
} |
17 |
|
18 |
-/* P->Parameters = (unsigned char*) wmf_malloc (API,(MAX_REC_SIZE(API)-3) * 2 * sizeof (unsigned char)); |
19 |
- */ P->Parameters = (unsigned char*) wmf_malloc (API,(MAX_REC_SIZE(API) ) * 2 * sizeof (unsigned char)); |
20 |
+ if (MAX_REC_SIZE(API) > UINT32_MAX / 2) |
21 |
+ { |
22 |
+ API->err = wmf_E_InsMem; |
23 |
+ WMF_DEBUG (API,"bailing..."); |
24 |
+ return (API->err); |
25 |
+ } |
26 |
+ |
27 |
+ P->Parameters = (unsigned char*) wmf_malloc (API,(MAX_REC_SIZE(API) ) * 2 * sizeof (unsigned char)); |
28 |
|
29 |
if (ERR (API)) |
30 |
{ WMF_DEBUG (API,"bailing..."); |