summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/cpio/lib/rtapelib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/cpio/lib/rtapelib.c b/contrib/cpio/lib/rtapelib.c
index af19b04..d73d136 100644
--- a/contrib/cpio/lib/rtapelib.c
+++ b/contrib/cpio/lib/rtapelib.c
@@ -570,7 +570,8 @@ rmt_read__ (int handle, char *buffer, size_t length)
sprintf (command_buffer, "R%lu\n", (unsigned long) length);
if (do_command (handle, command_buffer) == -1
- || (status = get_status (handle)) == SAFE_READ_ERROR)
+ || (status = get_status (handle)) == SAFE_READ_ERROR
+ || status > length)
return SAFE_READ_ERROR;
for (counter = 0; counter < status; counter += rlen, buffer += rlen)
OpenPOWER on IntegriCloud