]> git.wh0rd.org - dump.git/blobdiff - rmt/rmt.c
Security fixes from Antonomasia.
[dump.git] / rmt / rmt.c
index 7f93f57cf32991dd70d96fa329d05ab867db7cb5..3bd6207406336874a960410a365583ecc597eed2 100644 (file)
--- a/rmt/rmt.c
+++ b/rmt/rmt.c
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  *
@@ -41,7 +37,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: rmt.c,v 1.23 2003/02/12 11:02:31 stelian Exp $";
+       "$Id: rmt.c,v 1.25 2003/03/31 10:09:41 stelian Exp $";
 #endif /* not linux */
 
 /*
@@ -191,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) {
@@ -421,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')