Article View: comp.bugs.2bsd
Article #1~p causes 'cu'/'tip' to crash (#68)
From: Steven M. Schultz
Date: Fri, 24 Jul 1992 16:41
Date: Fri, 24 Jul 1992 16:41
59 lines
2078 bytes
2078 bytes
Subject: ~p causes 'cu'/'tip' to crash (#68)
Index: usr.bin/tip/cmds.c 2.11BSD
Description:
Using the ~p command to "put" a file to a remote system
causes a segmentation violation.
Repeat-By:
'cu' to a system and use ~p to transfer a file. The [put] prompt
appears. Enter the filename followed by a return and observe
the segmentation violation.
Fix:
The local variable "copynamex" conflicted with the global buffer
"copyname". Renaming the "copynamex" to "cpynamex" to make it
unique fixed the problem.
Apply the patch below and reinstall 'cu'.
===========================================================================
*** /usr/src/usr.bin/tip/cmds.c.old Tue Sep 20 15:15:54 1988
--- /usr/src/usr.bin/tip/cmds.c Fri Jul 24 09:05:01 1992
***************
*** 352,358 ****
char line[BUFSIZ];
int argc;
char *expand();
! char *copynamex;
if (prompt("[put] ", copyname))
return;
--- 352,358 ----
char line[BUFSIZ];
int argc;
char *expand();
! char *cpynamex;
if (prompt("[put] ", copyname))
return;
***************
*** 362,370 ****
}
if (argc == 1)
argv[1] = argv[0];
! copynamex = expand(argv[0]);
! if ((fd = fopen(copynamex, "r")) == NULL) {
! printf("%s: cannot open\r\n", copynamex);
return;
}
if (boolean(value(ECHOCHECK)))
--- 362,370 ----
}
if (argc == 1)
argv[1] = argv[0];
! cpynamex = expand(argv[0]);
! if ((fd = fopen(cpynamex, "r")) == NULL) {
! printf("%s: cannot open\r\n", cpynamex);
return;
}
if (boolean(value(ECHOCHECK)))
Technical Details
Message-ID:
<1992Jul24.164121.11951@wlbr.iipo.gtegsc.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!swrinde!elroy.jpl.nasa.gov!mahendo!awds.imsd.contel.com!wlbr!smsShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!swrinde!elroy.jpl.nasa.gov!mahendo!awds.imsd.contel.com!wlbr!sms From: sms@WLV.IIPO.GTEGSC.COM (Steven M. Schultz) Newsgroups: comp.bugs.2bsd Subject: ~p causes 'cu'/'tip' to crash (#68) Message-ID: <1992Jul24.164121.11951@wlbr.iipo.gtegsc.com> Date: 24 Jul 92 16:41:21 GMT Sender: news@wlbr.iipo.gtegsc.com (news) Organization: GTE Government Systems Lines: 59 Nntp-Posting-Host: wlv.iipo.gtegsc.com