home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / bugs / 2bsd / 75 next >
Encoding:
Text File  |  1992-07-25  |  2.0 KB  |  71 lines

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!swrinde!elroy.jpl.nasa.gov!mahendo!awds.imsd.contel.com!wlbr!sms
  2. From: sms@WLV.IIPO.GTEGSC.COM (Steven M. Schultz)
  3. Newsgroups: comp.bugs.2bsd
  4. Subject: ~p causes 'cu'/'tip' to crash   (#68)
  5. Message-ID: <1992Jul24.164121.11951@wlbr.iipo.gtegsc.com>
  6. Date: 24 Jul 92 16:41:21 GMT
  7. Sender: news@wlbr.iipo.gtegsc.com (news)
  8. Organization: GTE Government Systems
  9. Lines: 59
  10. Nntp-Posting-Host: wlv.iipo.gtegsc.com
  11.  
  12. Subject: ~p causes 'cu'/'tip' to crash   (#68)
  13. Index:    usr.bin/tip/cmds.c 2.11BSD
  14.  
  15. Description:
  16.     Using the  ~p command to "put" a file to a remote system
  17.     causes a segmentation violation.
  18.  
  19. Repeat-By:
  20.     'cu' to a system and use ~p to transfer a file.  The [put] prompt
  21.     appears.  Enter the filename followed by a return and observe
  22.     the segmentation violation.
  23.  
  24. Fix:
  25.     The local variable "copynamex" conflicted with the global buffer
  26.     "copyname".  Renaming the "copynamex" to "cpynamex" to make it 
  27.     unique fixed the problem.
  28.  
  29.     Apply the patch below and reinstall 'cu'.
  30. ===========================================================================
  31. *** /usr/src/usr.bin/tip/cmds.c.old    Tue Sep 20 15:15:54 1988
  32. --- /usr/src/usr.bin/tip/cmds.c    Fri Jul 24 09:05:01 1992
  33. ***************
  34. *** 352,358 ****
  35.       char line[BUFSIZ];
  36.       int argc;
  37.       char *expand();
  38. !     char *copynamex;
  39.   
  40.       if (prompt("[put] ", copyname))
  41.           return;
  42. --- 352,358 ----
  43.       char line[BUFSIZ];
  44.       int argc;
  45.       char *expand();
  46. !     char *cpynamex;
  47.   
  48.       if (prompt("[put] ", copyname))
  49.           return;
  50. ***************
  51. *** 362,370 ****
  52.       }
  53.       if (argc == 1)
  54.           argv[1] = argv[0];
  55. !     copynamex = expand(argv[0]);
  56. !     if ((fd = fopen(copynamex, "r")) == NULL) {
  57. !         printf("%s: cannot open\r\n", copynamex);
  58.           return;
  59.       }
  60.       if (boolean(value(ECHOCHECK)))
  61. --- 362,370 ----
  62.       }
  63.       if (argc == 1)
  64.           argv[1] = argv[0];
  65. !     cpynamex = expand(argv[0]);
  66. !     if ((fd = fopen(cpynamex, "r")) == NULL) {
  67. !         printf("%s: cannot open\r\n", cpynamex);
  68.           return;
  69.       }
  70.       if (boolean(value(ECHOCHECK)))
  71.