🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Steven M. Schultz Fri, 24 Jul 1992 16:41
~p causes 'cu'/'tip' to crash (#68)
#1
Author: Steven M. Schultz
Date: Fri, 24 Jul 1992 16:41
59 lines
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)))
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads