Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 953dcd855110118a303762321a186f4a > files > 16

tar-1.15.1-30.el5.src.rpm

diff -urNp tar-1.15.1-orig/lib/rtapelib.c tar-1.15.1/lib/rtapelib.c
--- tar-1.15.1-orig/lib/rtapelib.c	2004-09-06 15:49:42.000000000 +0200
+++ tar-1.15.1/lib/rtapelib.c	2010-02-25 14:10:01.000000000 +0100
@@ -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);