[3650] in SIPB bug reports

home help back first fref pref prev next nref lref last post

Re: Re: rt 7.4H: zctl

daemon@ATHENA.MIT.EDU (epeisach@Athena.MIT.EDU)
Sat Apr 10 17:17:47 1993

From: epeisach@Athena.MIT.EDU
Date: Sat, 10 Apr 93 17:17:32 -0400
To: bugs@Athena.MIT.EDU, bert@Athena.MIT.EDU
Cc: bug-sipb@Athena.MIT.EDU, bug-zephyr@Athena.MIT.EDU


A bug report came in indicating that 

   zctl set zwrite-signature \"

caused zctl to core dump.

I am sending this fix to bug-sipb because they developed the ss library
which is at fault. 

ss_parse on error returned NULL, and never set the the argc ptr. In
execute_cmd.c, the argc returned from ss_parse was checked for
an error. I looked in /usr/doc at the ss release notes that Ken
Raeburn was writing at one time and saw no documentation indicating what
the error return was. (I assume the NULL pointer was the intended
result, but the library clearly checked the returned argc itself). My
fix was to set the argc to 0 before parsing so that error returns would
be set in there as well. (The alternative fix was the checking for NULL)

Needless to say, this bug fix will be in the next release, whenever it
is.

This of course fixes the zctl bug.

	Ezra

RCS file: RCS/parse.c,v
retrieving revision 1.1
diff -c -r1.1 parse.c
*** /tmp/,RCSt1a24218	Sat Apr 10 17:16:41 1993
--- parse.c	Sat Apr 10 17:06:15 1993
***************
*** 42,47 ****
--- 42,48 ----
      register int argc;
      register enum parse_mode parse_mode;
  
+     *argc_ptr = 0;	/* In case of error return something sane */
      argv = (char **) malloc (sizeof(char *));
      if (argv == (char **)NULL) {
  	ss_error(sci_idx, errno, "Can't allocate storage");


home help back first fref pref prev next nref lref last post