Files
core/system/base/cpio/files/CVE-2010-0624-rpatelib-overflow.patch
T
2015-02-24 11:18:35 +02:00

15 lines
519 B
Diff

Index: cpio-2.9/lib/rtapelib.c
===================================================================
--- cpio-2.9.orig/lib/rtapelib.c
+++ cpio-2.9/lib/rtapelib.c
@@ -573,6 +573,9 @@ rmt_read__ (int handle, char *buffer, si
|| (status = get_status (handle)) == SAFE_READ_ERROR)
return SAFE_READ_ERROR;
+ if (status > length)
+ return SAFE_READ_ERROR;
+
for (counter = 0; counter < status; counter += rlen, buffer += rlen)
{
rlen = safe_read (READ_SIDE (handle), buffer, status - counter);