blob: a31573510aef3a7fd235c2298095e0378ef721e9 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001Upstream-Status: Inappropriate [bugfix: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-0624]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05002CVE: CVE-2010-0624
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003
4This patch avoids heap overflow reported by :
5http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-0624
6
7This is a clean patch for the GPLv2 tar recipe.
8
9the GPLv2 tar recipe patch is also applicable to this GPLv2 cpio
10recipe, as they share code.
11
12Nitin A Kamble <nitin.a.kamble@intel.com> 2011/04/25
13
14Index: 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)