X-Git-Url: https://git.wh0rd.org/?p=dump.git;a=blobdiff_plain;f=rmt%2Frmt.c;fp=rmt%2Frmt.c;h=3bd6207406336874a960410a365583ecc597eed2;hp=e977d95ac9afad1bef7d7d726603601f1870c691;hb=e2392789784483d5c142443388c1a0bf8508592b;hpb=206f768c7a7a4bca1c4acc3c686d55578c0cb919 diff --git a/rmt/rmt.c b/rmt/rmt.c index e977d95..3bd6207 100644 --- a/rmt/rmt.c +++ b/rmt/rmt.c @@ -37,7 +37,7 @@ #ifndef lint static const char rcsid[] = - "$Id: rmt.c,v 1.24 2003/03/30 15:40:40 stelian Exp $"; + "$Id: rmt.c,v 1.25 2003/03/31 10:09:41 stelian Exp $"; #endif /* not linux */ /* @@ -187,6 +187,8 @@ top: case 'W': getstring(count); n = atoi(count); + if (n < 1) + exit(2); DEBUG2("rmtd: W %s (block = %lu)\n", count, block); record = checkbuf(record, n); for (i = 0; i < n; i += cc) { @@ -417,7 +419,7 @@ void getstring(char *bp) int i; char *cp = bp; - for (i = 0; i < SSIZE; i++) { + for (i = 0; i < SSIZE - 1; i++) { if (read(0, cp+i, 1) != 1) exit(0); if (cp[i] == '\n')