diff options
Diffstat (limited to 'recipes-extended/cpio/cpio-2.8/avoid_heap_overflow.patch')
-rw-r--r-- | recipes-extended/cpio/cpio-2.8/avoid_heap_overflow.patch | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/recipes-extended/cpio/cpio-2.8/avoid_heap_overflow.patch b/recipes-extended/cpio/cpio-2.8/avoid_heap_overflow.patch new file mode 100644 index 0000000..a315735 --- /dev/null +++ b/recipes-extended/cpio/cpio-2.8/avoid_heap_overflow.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | Upstream-Status: Inappropriate [bugfix: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-0624] | ||
2 | CVE: CVE-2010-0624 | ||
3 | |||
4 | This patch avoids heap overflow reported by : | ||
5 | http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-0624 | ||
6 | |||
7 | This is a clean patch for the GPLv2 tar recipe. | ||
8 | |||
9 | the GPLv2 tar recipe patch is also applicable to this GPLv2 cpio | ||
10 | recipe, as they share code. | ||
11 | |||
12 | Nitin A Kamble <nitin.a.kamble@intel.com> 2011/04/25 | ||
13 | |||
14 | Index: tar-1.17/lib/rtapelib.c | ||
15 | =================================================================== | ||
16 | --- tar-1.17.orig/lib/rtapelib.c | ||
17 | +++ tar-1.17/lib/rtapelib.c | ||
18 | @@ -570,7 +570,7 @@ rmt_read__ (int handle, char *buffer, si | ||
19 | |||
20 | sprintf (command_buffer, "R%lu\n", (unsigned long) length); | ||
21 | if (do_command (handle, command_buffer) == -1 | ||
22 | - || (status = get_status (handle)) == SAFE_READ_ERROR) | ||
23 | + || ((status = get_status (handle)) == SAFE_READ_ERROR) || (status > length)) | ||
24 | return SAFE_READ_ERROR; | ||
25 | |||
26 | for (counter = 0; counter < status; counter += rlen, buffer += rlen) | ||