Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | Upstream-Status: Inappropriate [bugfix: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-0624] |
| 2 | |
| 3 | This patch avoids heap overflow reported by : |
| 4 | http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-0624 |
| 5 | |
| 6 | This is a clean patch for the GPLv2 tar recipe. |
| 7 | |
| 8 | the GPLv2 tar recipe patch is also applicable to this GPLv2 cpio |
| 9 | recipe, as they share code. |
| 10 | |
| 11 | Nitin A Kamble <nitin.a.kamble@intel.com> 2011/04/25 |
| 12 | |
| 13 | Index: tar-1.17/lib/rtapelib.c |
| 14 | =================================================================== |
| 15 | --- tar-1.17.orig/lib/rtapelib.c |
| 16 | +++ tar-1.17/lib/rtapelib.c |
| 17 | @@ -570,7 +570,7 @@ rmt_read__ (int handle, char *buffer, si |
| 18 | |
| 19 | sprintf (command_buffer, "R%lu\n", (unsigned long) length); |
| 20 | if (do_command (handle, command_buffer) == -1 |
| 21 | - || (status = get_status (handle)) == SAFE_READ_ERROR) |
| 22 | + || ((status = get_status (handle)) == SAFE_READ_ERROR) || (status > length)) |
| 23 | return SAFE_READ_ERROR; |
| 24 | |
| 25 | for (counter = 0; counter < status; counter += rlen, buffer += rlen) |