home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / bsd / 5024 < prev    next >
Encoding:
Text File  |  1992-09-02  |  2.3 KB  |  66 lines

  1. Newsgroups: comp.unix.bsd
  2. Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!yale!umeecs!news-server.eecs.umich.edu!jdolter
  3. From: jdolter@eecs.umich.edu (James W. Dolter)
  4. Subject: Patch for 386bsd 0.1 /usr/bin/man
  5. Message-ID: <JDOLTER.92Sep2205937@sawtooth.eecs.umich.edu>
  6. Sender: news@zip.eecs.umich.edu (Mr. News)
  7. Organization: University of Michigan EECS Deptartment
  8. Distribution: comp
  9. Date: Thu, 3 Sep 1992 01:59:37 GMT
  10. Lines: 54
  11.  
  12.  
  13. Release:         386bsd 0.1
  14. Date:            September 02, 1992
  15. Program:         /usr/bin/man
  16. Bug Reported by: James Dolter <jdolter@sawtooth.eecs.umich.edu>
  17. Patch Provided:  YES
  18.  
  19. Description: In the function config.c:cadd() the pointer bp isn't recalculated
  20.              when the pathbuf needs to be realloced.  If realloc moves the
  21.              storage 'bp' is left hanging.  The bug manifests itself when
  22.              you modify man.conf such that the pathbuf expands beyond 1k.
  23.  
  24. Patch provided below:
  25.  
  26. *** 1.1    1992/09/02 20:21:35
  27. --- /usr/src/usr.bin/man/man/config.c    1992/09/03 00:25:36
  28. ***************
  29. *** 98,110 ****
  30.       static size_t buflen;
  31.       static char *bp, *endp;
  32.       register size_t len2;
  33.   
  34.       len2 = add2 ? strlen(add2) : 0;
  35.       if (!bp || bp + len1 + len2 + 2 >= endp) {
  36.           if (!(pathbuf = realloc(pathbuf, buflen += 1024)))
  37.               enomem();
  38. !         if (!bp)
  39. !             bp = pathbuf;
  40.           endp = pathbuf + buflen;
  41.       }
  42.       bcopy(add1, bp, len1);
  43. --- 98,111 ----
  44.       static size_t buflen;
  45.       static char *bp, *endp;
  46.       register size_t len2;
  47. +     register size_t oldlen;
  48.   
  49.       len2 = add2 ? strlen(add2) : 0;
  50.       if (!bp || bp + len1 + len2 + 2 >= endp) {
  51. +         oldlen = bp - pathbuf;
  52.           if (!(pathbuf = realloc(pathbuf, buflen += 1024)))
  53.               enomem();
  54. !         bp = pathbuf + oldlen;
  55.           endp = pathbuf + buflen;
  56.       }
  57.       bcopy(add1, bp, len1);
  58. --
  59. +--------------------------------------------+--------------------------------+
  60. | James W. Dolter                            | Real-Time Computing Laboratory |
  61. | Internet: jdolter@sawtooth.eecs.umich.edu  | The University of Michigan     |
  62. | UUCP:     umich!umeecs!jdolter             | 1301 Beal Ave                  |
  63. | Office:   2222 EECS                        | Ann Arbor, MI 48109-2122       |
  64. | Voice:    (313) 763-5363                   |                                |
  65. +--------------------------------------------+--------------------------------+
  66.