summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rmt/rmt.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/rmt/rmt.c')
-rw-r--r--usr.sbin/rmt/rmt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/rmt/rmt.c b/usr.sbin/rmt/rmt.c
index 1a536aa..accebc6 100644
--- a/usr.sbin/rmt/rmt.c
+++ b/usr.sbin/rmt/rmt.c
@@ -184,9 +184,11 @@ top:
if (ioctl(tape, MTIOCGET, (char *)&mtget) < 0)
goto ioerror;
rval = sizeof (mtget);
+ if (rval > 24) /* original mtget structure size */
+ rval = 24;
(void)sprintf(resp, "A%d\n", rval);
(void)write(1, resp, strlen(resp));
- (void)write(1, (char *)&mtget, sizeof (mtget));
+ (void)write(1, (char *)&mtget, rval);
goto top;
}
OpenPOWER on IntegriCloud