home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.bsd
- Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!yale!umeecs!news-server.eecs.umich.edu!jdolter
- From: jdolter@eecs.umich.edu (James W. Dolter)
- Subject: Patch for 386bsd 0.1 /usr/bin/man
- Message-ID: <JDOLTER.92Sep2205937@sawtooth.eecs.umich.edu>
- Sender: news@zip.eecs.umich.edu (Mr. News)
- Organization: University of Michigan EECS Deptartment
- Distribution: comp
- Date: Thu, 3 Sep 1992 01:59:37 GMT
- Lines: 54
-
-
- Release: 386bsd 0.1
- Date: September 02, 1992
- Program: /usr/bin/man
- Bug Reported by: James Dolter <jdolter@sawtooth.eecs.umich.edu>
- Patch Provided: YES
-
- Description: In the function config.c:cadd() the pointer bp isn't recalculated
- when the pathbuf needs to be realloced. If realloc moves the
- storage 'bp' is left hanging. The bug manifests itself when
- you modify man.conf such that the pathbuf expands beyond 1k.
-
- Patch provided below:
-
- *** 1.1 1992/09/02 20:21:35
- --- /usr/src/usr.bin/man/man/config.c 1992/09/03 00:25:36
- ***************
- *** 98,110 ****
- static size_t buflen;
- static char *bp, *endp;
- register size_t len2;
-
- len2 = add2 ? strlen(add2) : 0;
- if (!bp || bp + len1 + len2 + 2 >= endp) {
- if (!(pathbuf = realloc(pathbuf, buflen += 1024)))
- enomem();
- ! if (!bp)
- ! bp = pathbuf;
- endp = pathbuf + buflen;
- }
- bcopy(add1, bp, len1);
- --- 98,111 ----
- static size_t buflen;
- static char *bp, *endp;
- register size_t len2;
- + register size_t oldlen;
-
- len2 = add2 ? strlen(add2) : 0;
- if (!bp || bp + len1 + len2 + 2 >= endp) {
- + oldlen = bp - pathbuf;
- if (!(pathbuf = realloc(pathbuf, buflen += 1024)))
- enomem();
- ! bp = pathbuf + oldlen;
- endp = pathbuf + buflen;
- }
- bcopy(add1, bp, len1);
- --
- +--------------------------------------------+--------------------------------+
- | James W. Dolter | Real-Time Computing Laboratory |
- | Internet: jdolter@sawtooth.eecs.umich.edu | The University of Michigan |
- | UUCP: umich!umeecs!jdolter | 1301 Beal Ave |
- | Office: 2222 EECS | Ann Arbor, MI 48109-2122 |
- | Voice: (313) 763-5363 | |
- +--------------------------------------------+--------------------------------+
-