[BusyBox] RDATE function

Larry Doolittle ldoolitt at recycle.lbl.gov
Thu Sep 27 10:24:26 UTC 2001


Matt -

>      if ((tserv = getservbyname("time", "tcp")) == NULL)   /* find port # */
> -             perror_msg_and_die("time");
> +             tserv->s_port = ntohl(37);

Looks like an instant null pointer dereference to me.
Care to try again?  Maybe something like:

	int tport = ntohl(37);   /* default if getservbyname fails */
	if ((tserv = getservbyname("time", "tcp")) != NULL)
		tport = tserv->s_port;
	// sockets happen
	s_in.sin_port = tport;
?

       - Larry





More information about the busybox mailing list