Yet ANOTHER null pointer dereference problem (in "cat")

Tony L. Hansen hansen at pegasus.UUCP
Fri Oct 4 13:33:21 AEST 1985


The zero deference bug still exists in my Vr2 code. Does anyone think that
for Vr3 they'll turn on the loader option to disallow zero deferences?

					Tony Hansen
					ihnp4!pegasus!hansen

*** /tmp/cat.c	Thu Oct  3 12:42:57 1985
--- /tmp/cat.c.new	Thu Oct  3 21:30:24 1985
***************
*** 79,85
  	}
  	for (argv = &argv[optind];
  	     optind < argc && !ferror(stdout); optind++, argv++) {
! 		if ((*argv)[0]=='-' && (*argv)[1]=='\0' || stdinflg)
  			fi = stdin;
  		else {
  			if ((fi = fopen(*argv, "r")) == NULL) {

--- 79,85 -----
  	}
  	for (argv = &argv[optind];
  	     optind < argc && !ferror(stdout); optind++, argv++) {
! 		if (stdinflg || ((*argv)[0]=='-' && (*argv)[1]=='\0'))
  			fi = stdin;
  		else {
  			if ((fi = fopen(*argv, "r")) == NULL) {



More information about the Net.bugs.usg mailing list